$(document).ready(function () {
  le_aa($(".btn-support"), $(".popup.support-selector-popup"));
  le_aa(
    $(".menu-selector"),
    $(".menu-selector").parent().find(".menu-dropdown")
  );
  le_aa($(".btn-game-wrapper"), $(".game-selector-popup"));
  le_ba();
});
function le_ba() {
  function a() {
    m = c.width() - 10;
    p = c.children().length;
    r = n[p - 1];
    r > m
      ? (c.children().last().prependTo(d), --p, a())
      : m > n[p] && (d.children().first().appendTo(c), (p += 1));
    b.attr("count", f - p);
    p === f ? b.addClass("hidden") : b.removeClass("hidden");
    c.css("overflow", "visible");
  }
  $(".nav-menu-container");
  var b = $(".nav-menu-container .menu-button"),
    c = $(".nav-menu-container .nav-menu"),
    d = $(".nav-menu-container .hidden-menu"),
    f = 0,
    k = 0,
    n = [];
  c.children().outerWidth(function (w, z) {
    k += z;
    f += 1;
    n.push(k);
  });
  var m, p, r;
  $(window).resize(function () {
    a();
  });
  b.on("click", function () {
    d.toggleClass("hidden");
  });
  a();
  setTimeout(function () {
    a();
  }, 0);
}
var le_ca = [];
function le_aa(a, b) {
  function c() {
    clearTimeout(f);
  }
  function d() {
    f = setTimeout(function () {
      b.removeClass("visible");
    }, 1e3);
  }
  var f;
  a.on("click", function (k) {
    for (var n = 0, m; (m = le_ca[n]); n++)
      m.Hd != b && (m.Hd.removeClass("visible"), clearTimeout(m.cf));
    k.preventDefault();
    b.toggleClass("visible");
    clearTimeout(f);
  });
  b.on("mouseleave", d).on("mouseenter", c);
  a.on("mouseleave", d).on("mouseenter", c);
  le_ca.push({ Hd: b, cf: f });
} /*
 js-cookie v3.0.5 | MIT */
function le_da() {
  var a = $(document.body);
  const b =
      a.is(document.body) || a.is(document) ? $(document.body) : a.parent(),
    c = a.is(document) ? window : a[0],
    d = ["control-scroll-top"];
  a.is(document.body)
    ? d.push("for-body")
    : a.is(document) && d.push("for-document");
  const f = $(
    '<div class="' +
      d.join(" ") +
      '"><div><svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" style="fill: #999;"><path d="M9.25 16V6.875l-4.188 4.187L4 10l6-6 6 6-1.062 1.062-4.188-4.187V16Z"></path></svg></div></div>'
  );
  f.hide();
  f.appendTo(b);
  f.click(function () {
    c.scrollTo({ top: 0, behavior: "smooth" });
  });
  a.scroll(function () {
    0 < a.scrollTop() ? f.show() : f.hide();
  });
}
const le_ea = /^(?:Beta |Version )(\d+)\.(\d+)\.(\d+)([a-z]?)$/,
  le_fa = /^(?:beta|version)(\d)(\d)(\d\d?)([a-z])?$/;
function le_ga(a) {
  if ((a = a.match(le_ea)))
    return { la: +a[1], Ia: +a[2], Ja: +a[3], cb: a[4] || "" };
}
function le_ha(a) {
  if ((a = a.match(le_fa)))
    return { la: +a[1], Ia: +a[2], Ja: +a[3], cb: a[4] || "" };
}
function le_ia(a) {
  if ((a = le_ga(a)))
    return `${0 == a.la ? "beta" : "version"}${a.la}${a.Ia}${a.Ja}${a.cb}`;
}
function le_ja(a, b = !1) {
  if ((a = le_ha(a)))
    return b
      ? 0 == a.la
        ? `${a.la}.${a.Ia}.${a.Ja}${a.cb}`
        : 0 == a.Ja
        ? `${a.la}.${a.Ia}${a.cb}`
        : `${a.la}.${a.Ia}.${a.Ja}${a.cb}`
      : `${0 == a.la ? "Beta " : "Version "}${a.la}.${a.Ia}.${a.Ja}${a.cb}`;
}
function le_ka(a, b) {
  a = le_ga(a);
  b = le_ga(b);
  if (a.la < b.la) return -1;
  if (a.la > b.la) return 1;
  if (a.Ia < b.Ia) return -1;
  if (a.Ia > b.Ia) return 1;
  if (a.Ja < b.Ja) return -1;
  if (a.Ja > b.Ja) return 1;
  a = a.cb || "a";
  b = b.cb || "a";
  return a < b ? -1 : a > b ? 1 : 0;
}
function le_la(a) {
  return (a = le_ga(a)) ? le_ma[0 == a.la ? 0 : a.la + 1] : null;
}
function le_na(a) {
  return Object.values(le_ma).find(function (b) {
    return b.tag == a;
  });
}
function le_oa(a) {
  return (a = le_na(a)) ? le_pa(a) : "";
}
function le_a(a) {
  var b = b || 0;
  a *= Math.pow(10, b);
  const c = Math.round(a);
  return (
    (0.5 === Math.abs(a) % 1 ? (0 === c % 2 ? c : c - 1) : c) / Math.pow(10, b)
  );
}
function le_qa([a = "", ...b]) {
  return [a.toUpperCase(), ...b].join("");
}
function le_ra(a) {
  return a
    .split(" ")
    .map((b) => b[0].toUpperCase() + b.substring(1))
    .join(" ");
}
!(function (a, b) {
  "object" == typeof exports && "undefined" != typeof module
    ? (module.exports = b())
    : "function" == typeof define && define.le
    ? define(b)
    : ((a = "undefined" != typeof globalThis ? globalThis : a || self),
      (function () {
        var c = a.Cookies,
          d = (a.Cookies = b());
        d.noConflict = function () {
          return (a.Cookies = c), d;
        };
      })());
})(this, function () {
  function a(b) {
    for (var c = 1; c < arguments.length; c++) {
      var d = arguments[c],
        f;
      for (f in d) b[f] = d[f];
    }
    return b;
  }
  return (function f(c, d) {
    function k(n, m, p) {
      if ("undefined" != typeof document) {
        "number" == typeof (p = a({}, d, p)).expires &&
          (p.expires = new Date(Date.now() + 864e5 * p.expires));
        p.expires && (p.expires = p.expires.toUTCString());
        n = encodeURIComponent(n)
          .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
          .replace(/[()]/g, escape);
        var r = "",
          w;
        for (w in p)
          p[w] &&
            ((r += "; " + w), !0 !== p[w] && (r += "=" + p[w].split(";")[0]));
        return (document.cookie = n + "=" + c.write(m, n) + r);
      }
    }
    return Object.create(
      {
        set: k,
        get: function (n) {
          if ("undefined" != typeof document && (!arguments.length || n)) {
            for (
              var m = document.cookie ? document.cookie.split("; ") : [],
                p = {},
                r = 0;
              r < m.length;
              r++
            ) {
              var w = m[r].split("="),
                z = w.slice(1).join("=");
              try {
                var I = decodeURIComponent(w[0]);
                if (((p[I] = c.read(z, I)), n === I)) break;
              } catch (N) {}
            }
            return n ? p[n] : p;
          }
        },
        remove: function (n, m) {
          k(n, "", a({}, m, { expires: -1 }));
        },
        Dg: function (n) {
          return f(this.Ed, a({}, this.attributes, n));
        },
        Eg: function (n) {
          return f(a({}, this.Ed, n), this.attributes);
        },
      },
      {
        attributes: { value: Object.freeze(d) },
        Ed: { value: Object.freeze(c) },
      }
    );
  })(
    {
      read: function (c) {
        return (
          '"' === c[0] && (c = c.slice(1, -1)),
          c.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
        );
      },
      write: function (c) {
        return encodeURIComponent(c).replace(
          /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
          decodeURIComponent
        );
      },
    },
    { path: "/" }
  );
});
const le_ma = {
  0: {
    tag: "beta",
    name: "Beta",
    md: "UI.Cycles_Beta",
    ce: new Date(Date.UTC(2023, 4, 26, 16, 0, 0)),
    Id: null,
  },
  1: {
    tag: "legacy",
    name: "Legacy",
    md: "UI.Cycles_Legacy",
    ce: null,
    Id: null,
  },
  2: {
    tag: "release",
    name: "Release",
    md: "UI.Cycles_Release",
    ce: new Date(Date.UTC(2024, 1, 21, 16, 0, 0)),
    Id: null,
  },
};
const Tolgee = window["@tolgee/web"].Tolgee,
  le_sa = window["@tolgee/web"].BackendFetch,
  le_ta = window["@tolgee/web"].LanguageStorage,
  le_ua = window["@tolgee/format-icu"].FormatIcu;
function le_va(a) {
  window.dayjs && window.dayjs.locale(a.g);
}
function le_wa(a) {
  a.m = !a.l.t({
    key: "LE_Tools.no_game_translations",
    orEmpty: !0,
    ns: "full",
  });
}
function le_xa(a, b) {
  if (-1 == b.indexOf("[")) return b;
  if (!c) var c = a.A;
  const d = b.split(a.I);
  if (!d) return b;
  let f = null;
  for (let k = 0; k < d.length; k++) {
    const n = d[k].match(a.C);
    if (n[1] && n[1].toLowerCase() == c) return n[2];
    null == f && (f = n[2]);
  }
  return f || b;
}
function le_b(a) {
  var b = le_;
  a = b.t(a, void 0, void 0, "full") || "";
  return b.g == b.i ? a : le_xa(b, a);
}
function le_c(a) {
  var b = le_;
  return b.g == b.i ? a : a + "/" + b.g;
}
class le_ya {
  constructor() {
    var a = availableLanguages;
    this.i = "en";
    this.availableLanguages = a;
    this.g = this.i;
    this.ready = this.j = !1;
    this.m = !0;
    this.I = /(?=\[(?:ms|fs|ns|mp|fp|np|s|p)\])/i;
    this.C = /(?:\[(ms|fs|ns|mp|fp|np|s|p)\])?(.+)/i;
    this.A = "ms";
    this.B = /<b>/g;
    this.o = /<\/b>/g;
  }
  init(a) {
    if (this.j) throw Error("Intl is already initialized");
    this.j = !0;
    var b = a.namespaces;
    const c = a.ve,
      d = a.we,
      f = a.$e,
      k = a.Mc;
    a = a.Lc;
    this.l = Tolgee()
      .use(le_ta())
      .use(le_ua())
      .use(
        le_sa({
          getPath: function ({ namespace: n, language: m }) {
            return n
              ? 1 <= le_ha(c).la
                ? `http://127.0.0.1:8080/data/${c}/i18n/${n}/${m}.json?${d}`
                : `http://127.0.0.1:8080/data/i18n_fallback/${n}/${m}.json`
              : `http://127.0.0.1:8080/static_data/i18n/${m}.json?${f}`;
          },
        })
      )
      .init({
        defaultLanguage: this.i,
        availableLanguages: this.availableLanguages,
        defaultNs: "",
        ns: [""].concat(b || []),
      });
    this.Mc = k;
    this.Lc = a;
    b = Cookies.get("app_lang");
    null != b
      ? (this.g = b)
      : ((this.g = this.i), Cookies.set("app_lang", this.g));
    le_va(this);
  }
  run() {
    const a = this;
    a.l.run().then(function () {
      a.ready = !0;
      le_wa(a);
      a.Mc && a.Mc();
    });
    a.l.on("language", function () {
      le_wa(a);
      a.Lc && a.Lc();
    });
  }
  changeLanguage(a) {
    if (!this.j) throw Error("Intl not initialized");
    this.g != a &&
      ((this.g = a),
      le_va(this),
      Cookies.set("app_lang", this.g),
      this.l.changeLanguage(this.g));
  }
  getLanguage() {
    return this.l.getLanguage();
  }
  t(a, b, c = null, d = null) {
    if (!this.j) throw Error("Intl not initialized");
    if (!this.ready) throw Error("Intl not ready");
    (b = this.l.t({ key: a, params: b, orEmpty: !0, ns: d || "" })) ||
      console.error(`i18n: no translation for key ${a}`);
    null != c &&
      (b =
        "" == c
          ? b.replace(this.B, "").replace(this.o, "")
          : b
              .replace(this.B, `<span class='${c}'>`)
              .replace(this.o, "</span>"));
    return b;
  }
}
const le_ = new le_ya();
window.getText = function (a, b, c, d) {
  return le_.t(a, b, c, d);
};
window.changeLangI18N = function (a) {
  le_.changeLanguage(a);
};
function le_pa(a) {
  return le_.m ? ((a = le_b(a.md)), le_qa(a)) : a.name;
}
function le_d(a) {
  return null != a.displayNameKey ? le_b(a.displayNameKey) : a.displayName;
}
function le_za(a) {
  return null != a.descriptionKey ? le_b(a.descriptionKey) : a.description;
}
function le_Aa(a) {
  return null != a.descriptionKey ? le_b(a.descriptionKey) : a.description;
}
function le_Ba(a) {
  return null != a.altTextKey ? le_b(a.altTextKey) : a.altText;
}
function le_Ca(a) {
  return null != a.loreTextKey ? le_b(a.loreTextKey) : a.loreText;
}
function le_Da(a) {
  return null != a.affixDisplayNameKey
    ? le_b(a.affixDisplayNameKey)
    : a.affixDisplayName;
}
function le_Ea(a) {
  return null != a.affixTitleKey ? le_b(a.affixTitleKey) : a.affixTitle;
}
function le_Fa(a) {
  return null != a.modDisplayNameKey
    ? le_b(a.modDisplayNameKey)
    : a.modDisplayName;
}
function le_Ga(a) {
  return null != a.nameKey ? le_b(a.nameKey) : a.name;
}
function le_Ha(a) {
  return null != a.nameKey ? le_b(a.nameKey) : a.name;
}
function le_Ia(a) {
  return null != a.monsterNameKey ? le_b(a.monsterNameKey) : a.monsterName;
}
function le_Ja(a) {
  return null != a.propertyNameKey ? le_b(a.propertyNameKey) : a.propertyName;
}
function le_Ka(a) {
  return null != a.altTextKey ? le_b(a.altTextKey) : a.altText;
}
function le_La(a) {
  switch (a) {
    case 0:
      return "Common.Era_Name_Ancient";
    case 1:
      return "Common.Era_Name_Divine";
    case 2:
      return "Common.Era_Name_Imperial";
    case 3:
      return "Common.Era_Name_Ruined";
    case 4:
      return "Common.Era_Name_EndOfTime";
    default:
      return "";
  }
}
function le_Ma(a) {
  switch (a) {
    case 0:
      return "Ancient Era";
    case 1:
      return "Divine Era";
    case 2:
      return "Imperial Era";
    case 3:
      return "Ruined Era";
    case 4:
      return "End Of Time";
    default:
      return "";
  }
}
function le_Na(a) {
  return null != a.nameKey ? le_b(a.nameKey) : a.name;
}
function le_Oa(a) {
  return null != a.nameKey ? le_b(a.nameKey) : a.name;
}
function le_Pa(a, b, c = !0) {
  var d = le_Qa;
  return le_.m ? ((a = le_b(d.g[a][b])), le_Ra(a, c)) : d.i[a][b];
}
function le_Sa(a, b = !0) {
  return le_Pa(a, 0, b);
}
function le_Ra(a, b = !0) {
  return le_.g == le_.i ? le_ra(a) : b ? le_qa(a) : a;
}
function le_e(a, b = !0) {
  return null != a.nameKey ? ((a = le_b(a.nameKey)), le_Ra(a, b)) : a.name;
}
function le_f(a) {
  return null != a.nameKey ? le_b(a.nameKey) : a.name;
}
function le_Ta(a) {
  return null != a.descriptionKey ? le_b(a.descriptionKey) : a.description;
}
function le_g(a) {
  return null != a.displayNameKey ? le_b(a.displayNameKey) : a.displayName;
}
function le_Ua(a) {
  return null != a.descriptionKey ? le_b(a.descriptionKey) : a.description;
}
class le_Va {
  constructor() {
    this.g = [
      [
        "Common.Mastery_Primalist",
        "Common.Mastery_Beastmaster",
        "Common.Mastery_Shaman",
        "Common.Mastery_Druid",
      ],
      [
        "Common.Mastery_Mage",
        "Common.Mastery_Sorcerer",
        "Common.Mastery_Spellblade",
        "Common.Mastery_Runemaster",
      ],
      [
        "Common.Mastery_Sentinel",
        "Common.Mastery_Void Knight",
        "Common.Mastery_Forge Guard",
        "Common.Mastery_Paladin",
      ],
      [
        "Common.Mastery_Acolyte",
        "Common.Mastery_Necromancer",
        "Common.Mastery_Lich",
        "Common.Mastery_Warlock",
      ],
      [
        "Common.Mastery_Rogue",
        "Common.Mastery_Bladedancer",
        "Common.Mastery_Marksman",
        "Common.Mastery_Falconer",
      ],
    ];
    this.i = [
      ["Primalist", "Beastmaster", "Shaman", "Druid"],
      ["Mage", "Sorcerer", "Spellblade", "Runemaster"],
      ["Sentinel", "Void Knight", "Forge Guard", "Paladin"],
      ["Acolyte", "Necromancer", "Lich", "Warlock"],
      ["Rogue", "Blade Dancer", "Marksman", "Falconer"],
    ];
  }
}
const le_Qa = new le_Va();
let le_Wa = [];
function le_Xa() {
  let a = !1;
  le_Wa.forEach(function (b) {
    b.state.isVisible && (a = !0);
  });
  return a;
}
window.isAnyTippyVisible = le_Xa;
function le_h(a, b) {
  if (window.nitroAds) {
    var c = $("#" + a).parent(),
      d = le_Ya[c.attr("s")];
    b || ($("#" + a).remove(), $('<div id="' + a + '">').appendTo(c));
    window.nitroAds.createAd(a, {
      refreshLimit: 0,
      refreshTime: 30,
      refreshVisibleOnly: !0,
      sizes: d,
      demo: "le.tools" == location.host,
    });
  }
}
var le_Ya = {
  v: [[160, 600]],
  vb: [
    [300, 600],
    [160, 600],
    [300, 250],
  ],
  h: [[728, 90]],
  hb: [
    [970, 90],
    [728, 90],
  ],
  hs: [
    [320, 50],
    [300, 50],
  ],
};
function le_Za(a, b) {
  return a.C.replace("(:num)", b);
}
function le__a(a) {
  return a.i < a.g ? a.i + 1 : null;
}
function le_0a(a) {
  return 1 < a.i ? a.i - 1 : null;
}
function le_1a(a, b, c = !1) {
  return { num: b, url: le_Za(a, b), isCurrent: c };
}
function le_2a(a) {
  const b = [];
  if (1 >= a.g) return b;
  if (a.g <= a.j) for (var c = 1; c <= a.g; c++) b.push(le_1a(a, c, c == a.i));
  else {
    c = Math.floor((a.j - 3) / 2);
    var d = a.i + c > a.g ? a.g - a.j + 2 : a.i - c;
    2 > d && (d = 2);
    c = d + a.j - 3;
    c >= a.g && (c = a.g - 1);
    b.push(le_1a(a, 1, 1 == a.i));
    for (2 < d && b.push({ num: "...", url: null, isCurrent: !1 }); d <= c; d++)
      b.push(le_1a(a, d, d == a.i));
    c < a.g - 1 && b.push({ num: "...", url: null, isCurrent: !1 });
    b.push(le_1a(a, a.g, a.i == a.g));
  }
  return b;
}
function le_3a(a) {
  const b = {
    "&": "&amp;",
    "<": "&lt;",
    ">": "&gt;",
    '"': "&quot;",
    "'": "&#039;",
  };
  return ("" + a).replace(/[&<>"']/g, function (c) {
    return b[c];
  });
}
function le_4a(a) {
  if (1 >= a.g) return "";
  let b = '<ul class="pagination">';
  b =
    le_0a(a) && le_Za(a, le_0a(a))
      ? b +
        `<li><a href="${le_3a(le_0a(a) ? le_Za(a, le_0a(a)) : null)}">${
          a.o
        }</a></li>`
      : b + `<li class="disabled"><span>${a.o}</span></li>`;
  le_2a(a).forEach(function (c) {
    b = c.url
      ? b +
        `<li${c.isCurrent ? ' class="active"' : ""}><a href="${le_3a(
          c.url
        )}">${le_3a(c.num)}</a></li>`
      : b + `<li class="disabled"><span>${le_3a(c.num)}</span></li>`;
  });
  b =
    le__a(a) && le_Za(a, le__a(a))
      ? b +
        `<li><a href="${le_3a(le__a(a) ? le_Za(a, le__a(a)) : null)}">${
          a.m
        }</a></li>`
      : b + `<li class="disabled"><span>${a.m}</span></li>`;
  return (b += "</ul>");
}
class le_5a {
  constructor(a, b, c, d = "") {
    this.B = a;
    this.l = b;
    this.i = c;
    this.C = d;
    this.g = 0;
    this.j = 10;
    this.o = le_.t("common.paging.previous_button");
    this.m = le_.t("common.paging.next_button");
    this.g = 0 == this.l ? 0 : Math.ceil(this.B / this.l);
  }
}
async function le_6a(a, b) {
  try {
    const c = await navigator.clipboard.readText();
    a(c);
  } catch (c) {
    console.error("Unable to read clipboard", c), b();
  }
}
function le_7a(a) {
  const b = document.createElement("textarea");
  b.value = a;
  b.style.fontSize = "12pt";
  b.style.border = "0";
  b.style.padding = "0";
  b.style.margin = "0";
  b.style.top = "0";
  b.style.left = "0";
  b.style.position = "fixed";
  b.style.left = "-9999px";
  document.body.appendChild(b);
  b.focus();
  b.select();
  a = !1;
  try {
    a = document.execCommand("copy");
  } catch (c) {
    console.error("[Sync] copy error", c);
  }
  document.body.removeChild(b);
  return a;
}
function le_8a(a, b, c) {
  navigator.clipboard
    ? navigator.clipboard.writeText(a).then(
        function () {
          b();
        },
        function (d) {
          console.error("[Async] copy error: ", d);
          c();
        }
      )
    : le_7a(a)
    ? b()
    : c();
}
function le_9a(a) {
  switch (+a) {
    case 0:
      return le_.t("planner.stats.strength");
    case 1:
      return le_.t("planner.stats.vitality");
    case 2:
      return le_.t("planner.stats.intelligence");
    case 3:
      return le_.t("planner.stats.dexterity");
    case 4:
      return le_.t("planner.stats.attunement");
  }
}
function le_$a(a) {
  switch (+a) {
    case 0:
      return "strength";
    case 1:
      return "vitality";
    case 2:
      return "intelligence";
    case 3:
      return "dexterity";
    case 4:
      return "attunement";
  }
}
function le_ab(a) {
  const b = [];
  $.each(a, function (c, d) {
    0 < d &&
      ((c = $db.gd(c)),
      (d = le_.t(`skills.formatting.damage.${c}`, { value: d }, "mod-value")),
      b.push(d));
  });
  return b;
}
function le_i(a, b) {
  return le_j((b ? 100 * a : Math.round(100 * a)) + "%");
}
function le_j(a) {
  return '<span class="mod-value">' + a + "</span>";
}
function le_bb(a, b, c) {
  var d = le_ab(a.damage);
  if (0 == d.length) return null;
  const f = [];
  f.push(d.join(", "));
  var k = a.critType;
  d = a.critChance;
  var n = a.critMultiplier;
  a.hit || ((d = 0), (n = 1));
  if (b) {
    switch (k) {
      case 0:
        b = le_.t("skills.base.damage.crit_chance");
        k = le_.t("skills.base.damage.crit_multi");
        f.push(`${b} ${le_i(d)}`);
        f.push(`${k} ${le_i(n)}`);
        break;
      case 1:
        f.push(le_.t("skills.base.damage.no_crit_chance"));
        break;
      case 2:
        (n = le_.t("skills.base.damage.crit_chance")),
          f.push(`${n} ${le_i(d)}`),
          f.push(le_.t("skills.base.damage.no_crit_multi"));
    }
    d = le_i(a.addedDamageScaling);
    null != c &&
      ((c = le_.t("skills.base.damage.added_damage_scaling.per_second", {
        value: le_i(a.addedDamageScaling / c),
      })),
      (d = `${d} (${c})`));
    c = le_.t("skills.base.damage.added_damage_scaling");
    f.push(`${c} ${d}`);
    a.freezeRate &&
      ((c = le_.t("skills.base.damage.freeze_rate")),
      f.push(`${c} ${le_j(a.freezeRate)}`));
    a.additionalLeech &&
      ((c = le_.t("skills.base.damage.health_leech", {
        value: le_i(a.additionalLeech),
      })),
      f.push(c));
    a.increasedStunChance &&
      ((c = le_.t("skills.base.damage.increased_stun_chance")),
      f.push(`${c} ${le_i(a.increasedStunChance)}`));
    a.increasedStunDuration &&
      ((c = le_.t("skills.base.damage.increased_stun_duration")),
      f.push(`${c} ${le_i(a.increasedStunDuration)}`));
    $.each(a.penetration, function (m, p) {
      m = $db.gd(p.damageType);
      p = le_.t(`skills.base.damage.penetration.${m}`, {
        value: le_i(p.penetration),
      });
      f.push(p);
    });
    a.hit
      ? f.push(
          '<span class="is-hit">' +
            le_.t("skills.base.damage.is_hit") +
            "</span>"
        )
      : f.push(
          '<span class="is-not-hit">' +
            le_.t("skills.base.damage.not_hit") +
            "</span>"
        );
  }
  return f;
}
function le_k(a) {
  return '<span class="stat-value">' + a + "</span>";
}
function le_l(a) {
  return le_.t("skills.base.skill_duration", { count: a }, "mod-value");
}
function le_m(a) {
  return le_.t("skills.base.skill_range", { count: a }, "mod-value");
}
function le_cb(a, b) {
  return le_.t(
    "skills.base.skill_range_min_max",
    { min: a, max: b },
    "mod-value"
  );
}
function le_n(a, b, c, d) {
  d ? $(a).removeAttr("href") : $(a).attr("href", le_c(b) + c);
}
function le_o(a, b, c, d, f) {
  const k = f && f.Ke;
  f = !1;
  let n = "mouseenter focus";
  k && ((n = "click"), (f = !0));
  let m = k ? !1 : !0;
  a = tippy(a, {
    placement: "right",
    content: b,
    interactive: !0,
    arrow: !1,
    allowHTML: !0,
    hideOnClick: f,
    trigger: n,
    appendTo: document.body,
    onShow: function (p) {
      p.props.content.style.maxHeight = document.body.clientHeight + "px";
      k && $(document.body).addClass("tippy-shown");
    },
    onShown: function () {
      m = !0;
    },
    onHide: function () {
      return m;
    },
    onHidden: function () {
      k && !le_Xa() && $(document.body).removeClass("tippy-shown");
    },
  });
  d && c && d.push(a);
}
function le_p(a) {
  a.find("a").each(function () {
    $(this).attr("target", "_blank");
  });
}
function le_q(a, b, c, d, f, k) {
  k = k || {};
  const n = k.Ke;
  b.find("a").each(function (m, p) {
    m = $(p).attr("section_ailment_id");
    var r = $(p).attr("section_ability_id"),
      w = $(p).attr("section_entity_id");
    m
      ? le_n(p, "/ailments", `/${m}`, n)
      : r
      ? le_n(p, "/skills", `/${r}`, n)
      : w && le_n(p, "/minions", `/${w}`);
    const z = $(p).attr("ailment_id"),
      I = $(p).attr("ability_id"),
      N = $(p).attr("parent_ability_id");
    $(p).attr("entity_id");
    r = $(p).attr("tree_node_id");
    const C = $(p).attr("tree_node_tree_id"),
      G = $(p).attr("tree_node_passive");
    m = $(p).attr("tree_node_points");
    const H = $(p).attr("item_id") || $(p).attr("item-id"),
      x = $(p).attr("prefix_id") || $(p).attr("prefix-id"),
      v = $(p).attr("suffix_id") || $(p).attr("suffix-id"),
      D = $(p).attr("item_set_id") || $(p).attr("item-set-id"),
      E = $(p).attr("c_item_id");
    w = $(p).attr("c_prefix1");
    const O = $(p).attr("c_prefix2"),
      U = $(p).attr("c_suffix1"),
      L = $(p).attr("c_suffix2"),
      R = $(p).attr("c_sealed_affix");
    if (z && (d || !c.Ha[z])) {
      c.Ha[z] = !0;
      var F = le_db.format(z);
      F = $(F);
      le_p(F);
      le_q(a, F, c, !1, null, k);
      le_o(p, F[0], d, f, k);
    } else if (I && (d || !c.Xc[I]))
      (c.Xc[I] = !0),
        (F = le_eb.format(I, { td: !0, tg: N })),
        (F = $(F)),
        le_p(F),
        le_q(a, F, c, !1, null, k),
        le_o(p, F[0], d, f, k);
    else if (r && (d || !c.ge[C + ":" + r])) {
      c.ge[C + ":" + r] = !0;
      if (+G)
        (r = (w = $.grep(LECharTrees.trees, function (Z) {
          return Z.characterTree.treeID == C;
        })[0])
          ? w.characterTree.nodes[r]
          : null) &&
          (F = le_fb.ef.If(C, r, +m || 0, w.characterTree.characterClass, {
            td: !0,
          }));
      else if ((r = (w = LESkillTrees[C]) ? w.nodes[r] : null))
        (F = le_f(LEAbilities.abilityList[C])),
          (F = {
            td: !0,
            xf: le_.t("skills.formatting.skill_tree_node", {
              skillName: `<span class="emphasis">${F}</span>`,
            }),
          }),
          (F = le_fb.ef.Lf(C, r, +m || 0, F));
      F &&
        ((F = $(F)),
        le_p(F),
        le_q(a, F, c, !1, null, k),
        le_o(p, F[0], d, f, k));
    } else if (H && (d || !c.Jc[H])) {
      if (((c.Jc[H] = !0), (F = le_r[H] || le_s[H])))
        (m = $db.getItemClass(F)),
          (m = $db.formatItemCard(F, m, null)),
          (F = $db.oc(F)),
          (F = $('<div class="item-card ' + F + '">' + m + "</div>")),
          le_p(F),
          le_q(a, F, c, !1, null, k),
          le_gb(F, n),
          le_o(p, F[0], d, f, k);
    } else if (x && (d || !c.Xd[x])) {
      if (((c.Xd[x] = !0), (F = le_t[x])))
        (m = $db.getItemClass(F)),
          (m = $db.formatItemCard(F, m, null)),
          (F = $db.oc(F)),
          (F = $('<div class="item-card ' + F + '">' + m + "</div>")),
          le_p(F),
          le_q(a, F, c, !1, null, k),
          le_gb(F, n),
          le_o(p, F[0], d, f, k);
    } else if (v && (d || !c.de[v])) {
      if (((c.de[v] = !0), (F = le_u[v])))
        (m = $db.getItemClass(F)),
          (m = $db.formatItemCard(F, m, null)),
          (F = $db.oc(F)),
          (F = $('<div class="item-card ' + F + '">' + m + "</div>")),
          le_p(F),
          le_q(a, F, c, !1, null, k),
          le_gb(F, n),
          le_o(p, F[0], d, f, k);
    } else if (!E || (!d && c.Jc[E]))
      D &&
        (d || !c.Td[D]) &&
        ((c.Td[D] = !0), (F = le_hb[D])) &&
        ((F = $db.formatItemSetStandalone(F)),
        (F = $('<div class="item-card item-itemset">' + F + "</div>")),
        le_p(F),
        le_q(a, F, c, !1, null, k),
        le_gb(F, n),
        le_o(p, F[0], d, f, k));
    else if (((c.Jc[E] = !0), (F = le_r[E] || le_s[E]))) {
      const [Z, V] = (w || "").split(","),
        [S, sa] = (O || "").split(","),
        [na, ta] = (U || "").split(","),
        [da, ka] = (L || "").split(","),
        [X, Pa] = (R || "").split(",");
      F = $db.Dc({
        item: F,
        gb: Z ? le_t[Z] : null,
        qb: S ? le_t[S] : null,
        kb: na ? le_u[na] : null,
        ub: da ? le_u[da] : null,
        uc: X ? le_t[X] || le_u[X] : null,
        ib: V || 1,
        rb: sa || 1,
        lb: ta || 1,
        wb: ka || 1,
        vc: Pa || 1,
      });
      m = $db.getItemClass(F);
      m = $db.formatItemCard(F, m);
      F = $db.oc(F);
      F = $('<div class="item-card ' + F + '">' + m + "</div>");
      le_p(F);
      le_q(a, F, c, !1, null, k);
      le_gb(F, n);
      le_o(p, F[0], d, f, k);
    }
  });
  d && le_gb(b, n);
}
function le_gb(a, b) {
  $(a)
    .find("a")
    .each(function (c, d) {
      c = $(d).attr("item-id");
      const f = $(d).attr("prefix-id"),
        k = $(d).attr("suffix-id"),
        n = $(d).attr("item-set-id"),
        m = $(d).attr("timeline-id"),
        p = $(d).attr("dungeon-id"),
        r = $(d).attr("arena-id");
      c
        ? le_ib(d, "/items/" + c, b)
        : f
        ? le_ib(d, "/prefixes/" + f, b)
        : k
        ? le_ib(d, "/suffixes/" + k, b)
        : n
        ? le_ib(d, "/itemsets/" + n, b)
        : m
        ? "-" == m
          ? le_n(d, "/endgame", "/monolith", !1)
          : le_n(d, "/endgame", "/monolith/" + timelineData[m].slug, !1)
        : p
        ? "-" == p
          ? le_n(d, "/endgame", "/dungeons", !1)
          : le_n(d, "/endgame", "/dungeons/" + dungeonData[p].slug, !1)
        : r &&
          ("-" == r
            ? le_n(d, "/endgame", "/arenas", !1)
            : le_n(d, "/endgame", "/arenas/" + arenaData[r].slug, !1));
    });
}
function le_ib(a, b, c) {
  c ? $(a).removeAttr("href") : $(a).attr("href", le_c("/db") + b);
}
function le_jb() {
  return { Xc: {}, Ha: {}, wf: {}, ge: {}, Jc: {}, Xd: {}, de: {}, Td: {} };
}
function le_kb(a) {
  return a
    .replace(/[^A-Za-z0-9_ ]/g, "")
    .replace(/([A-Z]+)/g, " $1")
    .replace(/\s+/g, " ")
    .trim()
    .split(" ")
    .join("_")
    .toLowerCase();
}
class le_lb {
  g(a) {
    const b = [];
    le_q(this, a, le_jb(), !0, b, null);
    return b;
  }
}
var le_mb = new le_lb();
const le_fb = {};
function le_nb(a) {
  return a.icon ? "icons icons-" + a.icon.substr(2) : "ailment-icon-none";
}
function le_ob(a, b) {
  if (!a.dealsDamage) return null;
  a = le_ab(b);
  if (0 == a.length) return null;
  a = a.join(", ");
  b.hit || (a += " " + le_.t("ailments.ailment_card.damage_over_time"));
  return `${le_.t("skills.base.damage")} ${le_k(a)}`;
}
function le_pb(a) {
  const b = le_qb(a.buffs);
  let c = "";
  var d = a.maxStacksThatApplyBuffs;
  a =
    2 == a.buffScalingType && 0 < d && (1 != d || 1 != a.maxInstances)
      ? le_.t("ailments.ailment_card.only_first_x_stacks_aplly_buffs", {
          value: le_j(d),
        })
      : void 0;
  a && (c = '<div class="stat-extra">' + a + "</div>");
  return 0 < b.length
    ? "<div>" +
        le_.t("ailments.ailment_card.effects") +
        "</div>" +
        c +
        '<div class="ailment-param-group">' +
        b.join("") +
        "</div>"
    : null;
}
function le_rb(a) {
  if (a.spreads) {
    const b = [];
    b.push(
      le_.t("ailments.ailment_card.spread.range") +
        " " +
        le_k(le_m(a.spreadRange))
    );
    b.push(
      le_.t("ailments.ailment_card.spread.delay") +
        " " +
        le_k(le_l(a.spreadDelay))
    );
    b.push(
      le_.t("ailments.ailment_card.spread.max_targets") +
        " " +
        le_j(
          a.maxSpreadPerInstance ||
            le_.t("ailments.ailment_card.spread.max_targets.unlimited")
        )
    );
    a.spreadIfDiedBeforeDelay &&
      b.push(le_.t("ailments.ailment_card.spread.if_enemy_dies_before_delay"));
    const c = [];
    $.each(b, function (d, f) {
      c.push("<div>" + f + "</div>");
    });
    return (
      "<div>" +
      le_.t("ailments.ailment_card.spreads") +
      '</div><div class="ailment-param-group">' +
      c.join("") +
      "</div>"
    );
  }
  return null;
}
function le_sb(a, b, c) {
  return a && b && (a = LEAbilities.abilityList[b]) && le_v(b)
    ? ((b = le_w(a)),
      `<div class="stat-text">${le_.t(
        "ailments.ailment_card.procs_skill_when_reaches_stacks",
        { skillName: b, count: c },
        "mod-value"
      )}</div>`)
    : null;
}
function le_tb(a) {
  var b = a.abilityToProcOnExpiration;
  if (a.procsAbilityOnExpiration && b) {
    const c = LEAbilities.abilityList[b];
    if (c && le_v(b))
      return (
        (b = le_w(c)),
        `<div class="stat-text">${
          a.expirationAbilityProcsOnDeath
            ? le_.t(
                "ailments.ailment_card.procs_skill_when_expires_or_target_dies",
                { skillName: b }
              )
            : le_.t("ailments.ailment_card.procs_skill_when_expires", {
                skillName: b,
              })
        }</div>`
      );
  }
  return null;
}
function le_ub(a, b) {
  if (1 == a)
    return (
      (a = $db.gd(b)),
      `<div class="stat-extra">${le_.t(
        `ailments.ailment_card.increased_effect.penetration.${a}`
      )}</div>`
    );
}
function le_vb(a) {
  if (1 == a.effectOfEffectivenessOnProc)
    return `<div class="stat-extra">${le_.t(
      "ailments.ailment_card.increased_effect.proc_damage"
    )}</div>`;
  if (2 == a.effectOfEffectivenessOnProc)
    return `<div class="stat-extra">${le_.t(
      "ailments.ailment_card.increased_effect.decrease_stacks_for_proc"
    )}</div>`;
}
function le_wb(a, b) {
  const c = le_i(Math.abs(a));
  return 0 < a
    ? b
      ? le_.t("ailments.ailment_card.effect_buff.more_against_players", {
          value: c,
        })
      : le_.t("ailments.ailment_card.effect_buff.more_against_bosses", {
          value: c,
        })
    : b
    ? le_.t("ailments.ailment_card.effect_buff.less_against_players", {
        value: c,
      })
    : le_.t("ailments.ailment_card.effect_buff.less_against_bosses", {
        value: c,
      });
}
function le_xb(a) {
  const b = $db.getEnumerableTags(a.tags);
  -1 == b.indexOf(AT.Curse) && a.curse && b.push(AT.Curse);
  a = le_yb(b);
  return le_zb(a);
}
function le_Ab(a) {
  a = le_k(le_l(a));
  return le_.t("ailments.ailment_card.duration") + " " + a;
}
function le_Bb(a) {
  a = le_j(a || le_.t("ailments.ailment_card.max_stacks.unlimited"));
  return le_.t("ailments.ailment_card.max_stacks") + " " + a;
}
function le_yb(a) {
  const b = [];
  $.each(a, function (c, d) {
    b.push($db.getTextForAT(d));
  });
  return b;
}
function le_zb(a) {
  let b = "";
  $.each(a, function (c, d) {
    "" != b && (b += " ");
    b += '<span class="ailment-tag">' + d + "</span>";
  });
  return b;
}
function le_qb(a) {
  const b = [];
  $.each(a, function (c, d) {
    c = $db.formatBuff(d, $db.Nb());
    $.each(c, function (f, k) {
      b.push('<div class="buff">' + k + "</div>");
    });
  });
  return b;
}
function le_x(a) {
  return (
    '<div class="ailment-icon-name">' +
    (a.icon
      ? '<div class="ailment-icon-inline ' +
        (a.positive ? "positive" : "negative") +
        '"><div class="' +
        le_nb(a) +
        '"></div></div>'
      : '<div class="ailment-icon-inline"><div class="ailment-icon-none"></div></div>') +
    '<a href="#" class="ailment-link" ailment_id="' +
    a.id +
    '" section_ailment_id="' +
    le_kb(a.internalName) +
    '">' +
    le_g(a) +
    "</a></div>"
  );
}
class le_Cb extends le_lb {
  format(a) {
    const b = LEAbilities.ailmentList[a];
    if (!b) return console.error("ailment " + a + " not found"), "";
    a = le_g(b);
    const c = le_Ua(b) || "",
      d = b.positive ? "positive" : "negative",
      f = le_nb(b),
      k = [];
    var n = le_ob(b, b.baseDamage.damage);
    n && k.push(n);
    var m = le_pb(b);
    m && k.push(m);
    (m = le_rb(b)) && k.push(m);
    (m = le_sb(
      b.procsAbilityWhenStacksReached,
      b.abilityToProcWhenStacksReached,
      b.stacksRequiredForProc
    )) && k.push(m);
    (m = le_tb(b)) && k.push(m);
    b.dealsAllDamageAtEnd &&
      k.push(
        '<div class="stat-text">' +
          le_.t("ailments.ailment_card.deals_damage_at_the_end") +
          "</div>"
      );
    b.stopsWhenHit &&
      k.push(
        '<div class="stat-text">' +
          le_.t("ailments.ailment_card.applies_remaining_damage_when_hit") +
          "</div>"
      );
    b.blinds &&
      k.push(
        '<div class="stat-text">' +
          le_.t("ailments.ailment_card.blinds") +
          "</div>"
      );
    b.roots &&
      k.push(
        '<div class="stat-text">' +
          le_.t("ailments.ailment_card.immobilizes") +
          "</div>"
      );
    m = le_ub(
      b.effectOfIncreasedEffectiveness,
      b.additionalPenetrationDamageType
    );
    n && m && k.push(m);
    (n = le_vb(b)) && k.push(n);
    if (b.moreBuffEffectAgainstPlayers || b.moreBuffEffectAgainstBosses)
      (n = []),
        b.moreBuffEffectAgainstPlayers &&
          n.push(
            '<div class="stat-text">' +
              le_wb(b.moreBuffEffectAgainstPlayers, !0) +
              "</div>"
          ),
        b.moreBuffEffectAgainstBosses &&
          n.push(
            '<div class="stat-text">' +
              le_wb(b.moreBuffEffectAgainstBosses, !1) +
              "</div>"
          ),
        k.push(n.join(""));
    (n = le_xb(b)) && k.push('<div class="ailment-tags">' + n + "</div>");
    const p = [];
    $.each(k, function (r, w) {
      p.push('<div class="ailment-params with-divider">' + w + "</div>");
    });
    return (
      '<div class="ailment-card"><div class="top-block"><div class="ailment-bitmap-container ' +
      d +
      '"><div class="' +
      f +
      '"></div></div><div class="ailment-description-block"><div class="ailment-name" ailment_id="' +
      b.id +
      '">' +
      a +
      '</div><div class="ailment-description">' +
      c +
      '</div></div></div><div class="middle-block"><div class="ailment-params with-divider"><div>' +
      le_Ab(b.duration) +
      "</div><div>" +
      le_Bb(b.maxInstances) +
      "</div></div>" +
      p.join("") +
      "</div></div>"
    );
  }
  g(a) {
    const b = [],
      c = le_jb(),
      d = a.find("div.ailment-name").attr("ailment_id");
    c.Ha[d] = !0;
    le_q(this, a, c, !0, b, null);
    return b;
  }
}
var le_db = new le_Cb();
function le_w(a, b) {
  var c = "";
  b && (c = ' parent_ability_id="' + b.id + '"');
  b = le_f(a);
  c = a.internalName
    ? '<a href="#" class="ability-link"' +
      c +
      ' ability_id="' +
      a.id +
      '" section_ability_id="' +
      le_kb(a.internalName) +
      '">' +
      b +
      "</a>"
    : '<a href="#" class="ability-link"' +
      c +
      ' ability_id="' +
      a.id +
      '">' +
      b +
      "</a>";
  return (
    '<div class="ability-icon-name">' +
    (a.abilitySprite
      ? '<div class="ability-icon-inline"><div class="' +
        le_Db(a) +
        '"></div></div>'
      : '<div class="ability-icon-inline"><div class="ability-icon-none"></div></div>') +
    c +
    "</div>"
  );
}
function le_Eb(a) {
  const b = [];
  $.each(a.prefab.components, function (c, d) {
    switch (d.type) {
      case "DamageEnemyOnHit":
        d = le_ab(d.baseDamageStats.damage);
        0 < d.length &&
          (le_.t("skills.skill_card.view_invocations_link"),
          b.push(le_.t("skills.base.damage") + " " + le_k(d.join(", "))));
        break;
      case "RepeatedlyDamageParent":
      case "DamageEnemiesWithBeam":
      case "RepeatedlyDamageEnemiesWithinRadius":
      case "RepeatedlyDamageEnemiesWithinArc":
        (c = le_ab(d.baseDamageStats.damage)),
          0 < c.length &&
            ((d =
              le_.t("skills.base.damage.interval") +
              " " +
              le_l(d.damageInterval)),
            b.push(
              le_.t("skills.base.damage") + " " + le_k(c.join(", ")) + le_y(d)
            ));
    }
  });
  return b;
}
function le_Fb(a) {
  a = le_Gb(a);
  return le_Hb(a);
}
function le_Ib(a) {
  le_Jb();
  var b = $db.getEnumerableTags(a.minionTagsDisplay);
  b = le_Kb(b);
  a = a.areaTagDisplay;
  (a != le_Lb.MinionTagOnly && a != le_Lb.TagAndMinionTag) || b.push("Area");
  return le_Hb(b);
}
function le_Mb(a) {
  (a && "null" != a) || (a = "");
  return a
    .replace(/\{([^\}]+)\}/g, '<span style="color:#FFF">$1</span>')
    .replace(/\\n+/g, '<div class="separator"></div>')
    .replace(/\n+/g, '<div class="separator"></div>');
}
function le_Nb(a, b, c) {
  let d = !1,
    f = !1;
  $.each(b, function (x, v) {
    "HomingMovement" == v.type
      ? (f = !0)
      : "ExtraProjectiles" == v.type && (d = !0);
  });
  const k = [],
    n = [],
    m = [],
    p = [],
    r = [],
    w = [],
    z = [],
    I = [],
    N = [],
    C = [],
    G = [],
    H = [];
  $.each(b, function (x, v) {
    switch (v.type) {
      case "DamageEnemyOnHit":
        (x = le_bb(v.baseDamageStats, c)) && k.push(le_Ob(x));
        break;
      case "RepeatedlyDamageParent":
        if ((x = le_bb(v.baseDamageStats, c, v.damageInterval))) {
          var D = "";
          c &&
            ((D =
              le_.t("skills.base.damage.interval") +
              " " +
              le_l(v.damageInterval)),
            (D = le_y(D)));
          k.push(le_Ob(x, D));
        }
        break;
      case "DamageEnemiesWithBeam":
        if ((x = le_bb(v.baseDamageStats, c, v.damageInterval)))
          (D = ""),
            c &&
              ((D =
                le_.t("skills.base.damage.interval") +
                " " +
                le_l(v.damageInterval)),
              (D = le_y(D))),
            k.push(le_Ob(x, D));
        break;
      case "RepeatedlyDamageEnemiesWithinRadius":
        if ((x = le_bb(v.baseDamageStats, c, v.damageInterval))) {
          D = "";
          if (c) {
            D = [];
            D.push(le_.t("skills.base.damage.radius") + " " + le_m(v.radius));
            D.push(
              le_.t("skills.base.damage.interval") +
                " " +
                le_l(v.damageInterval)
            );
            if (v.damageIncreasePerInterval) {
              var E =
                le_.t("skills.base.damage.damage_increase_per_interval") +
                " " +
                le_i(v.damageIncreasePerInterval);
              if (v.limitMaxDamageIncreaseFromInterval) {
                var O = le_.t(
                  "skills.base.damage.damage_increase_per_interval.max",
                  { value: le_i(v.maxDamageIncreaseFromInterval) }
                );
                E += ` ${O}`;
              }
              D.push(E);
            }
            v.undodgeable && D.push(le_.t("skills.base.damage.cant_be_dodge"));
            D = le_y(D.join("<br/>"));
          }
          k.push(le_Ob(x, D));
        }
        break;
      case "RepeatedlyDamageEnemiesWithinArc":
        if ((x = le_bb(v.baseDamageStats, c, v.damageInterval)))
          (D = ""),
            c &&
              ((D = []),
              D.push(
                le_.t("skills.base.damage.arc") +
                  " " +
                  le_j(v.arcDegrees) +
                  "&deg;"
              ),
              D.push(
                le_.t("skills.base.damage.radius") +
                  " " +
                  le_cb(v.minRadius, v.maxRadius)
              ),
              D.push(
                le_.t("skills.base.damage.interval") +
                  " " +
                  le_l(v.damageInterval)
              ),
              v.damageIncreasePerInterval &&
                ((E =
                  le_.t("skills.base.damage.damage_increase_per_interval") +
                  " " +
                  le_i(v.damageIncreasePerInterval)),
                v.limitMaxDamageIncreaseFromInterval &&
                  ((O = le_.t(
                    "skills.base.damage.damage_increase_per_interval.max",
                    { value: le_i(v.maxDamageIncreaseFromInterval) }
                  )),
                  (E += ` ${O}`)),
                D.push(E)),
              v.undodgeable &&
                D.push(le_.t("skills.base.damage.cant_be_dodge")),
              (D = le_y(D.join("<br/>")))),
            k.push(le_Ob(x, D));
        break;
      case "ModifyDamageOnRotation":
        (x = le_Pb(v, c)) && k.push(x);
        break;
      case "IncreaseDamageOnHit":
        (x = le_Qb(v)) && k.push(x);
        break;
      case "ChanceToApplyAilmentsOnHit":
        $.each(v.ailments, function (L, R) {
          if ((L = le_Rb(R)))
            (L = le_.t(
              le_Sb(v.targetType),
              { chanceValue: le_i(R.chance), ailmentName: le_x(L) },
              "mod-value"
            )),
              (L += le_Tb(R)),
              n.push(L);
        });
        break;
      case "RepeatedlyApplyAilmentsInRadius":
        $.each(v.ailments, function (L, R) {
          if ((L = le_Rb(R)))
            (L = le_.t(
              le_Ub(v.targetType),
              {
                chanceValue: le_i(R.chance),
                ailmentName: le_x(L),
                metersValue: v.radius,
                secondsValue: v.applicationInterval,
              },
              "mod-value"
            )),
              (L += le_Tb(R)),
              n.push(L);
        });
        break;
      case "ApplyAilmentToCreator":
        $.each(v.ailments, function (L, R) {
          if ((L = le_Rb(R)))
            (L = v.applyRepeatedly
              ? le_.t(
                  "skills.skill_card.ailment_chance.target.to_yourself_repeatedly",
                  {
                    chanceValue: le_i(R.chance),
                    ailmentName: le_x(L),
                    secondsValue: v.interval,
                  },
                  "mod-value"
                )
              : le_.t(
                  "skills.skill_card.ailment_chance.target.to_yourself",
                  { chanceValue: le_i(R.chance), ailmentName: le_x(L) },
                  "mod-value"
                )),
              (L += le_Tb(R)),
              c &&
                v.scaleWithStats &&
                ((R = le_.t(
                  "skills.skill_card.ailment_chance.scales_with_stats"
                )),
                (L += le_y(R))),
              n.push(L);
        });
        break;
      case "ApplyAilmentToCreatorOnDeath":
        $.each(v.ailments, function (L, R) {
          if ((L = le_Rb(R)))
            (L = le_.t(
              "skills.skill_card.ailment_chance.target.to_yourself",
              { chanceValue: le_i(R.chance), ailmentName: le_x(L) },
              "mod-value"
            )),
              (L += le_Tb(R)),
              c &&
                v.scaleWithStats &&
                ((R = le_.t(
                  "skills.skill_card.ailment_chance.scales_with_stats"
                )),
                (L += le_y(R))),
              n.push(L);
        });
        break;
      case "ApplyAilmentToParent":
        $.each(v.ailments, function (L, R) {
          if ((L = le_Rb(R)))
            (L = v.applyRepeatedly
              ? le_.t(
                  "skills.skill_card.ailment_chance.target.to_enemies_repeatedly",
                  {
                    chanceValue: le_i(R.chance),
                    ailmentName: le_x(L),
                    secondsValue: v.interval,
                  },
                  "mod-value"
                )
              : le_.t(
                  "skills.skill_card.ailment_chance.target.to_enemies",
                  { chanceValue: le_i(R.chance), ailmentName: le_x(L) },
                  "mod-value"
                )),
              (L += le_Tb(R)),
              c &&
                v.scaleWithStats &&
                ((R = le_.t(
                  "skills.skill_card.ailment_chance.scales_with_stats"
                )),
                (L += le_y(R))),
              n.push(L);
        });
        break;
      case "SpreadAilmentsOnHit":
        (x = le_Vb(v)) && n.push(x);
        break;
      case "CastAfterDuration":
        G.push({ id: v.ability, delay: v.interval, Oa: v.castChance || 1 });
        break;
      case "CastAtRandomPointAfterDuration":
        G.push({ id: v.ability, delay: v.duration });
        break;
      case "CreateAbilityObjectOnStart":
      case "CreateAbilityObjectOnDeath":
        G.push({ id: v.abilityToInstantiate });
        break;
      case "CreateAbilityObjectOnNewEnemyHit":
        N.push({
          id: v.abilityToInstantiate,
          Oa: v.chance || 1,
          qg: v.limit || 1,
        });
        break;
      case "CreateRandomAbilityObjectOnDeath":
        let U = 0;
        $.each(v.possibleAbilities, function (L) {
          U += v.weights[L];
        });
        $.each(v.possibleAbilities, function (L, R) {
          G.push({ id: R, Oa: v.weights[L] / U });
        });
        break;
      case "ChanceToCreateAbilityObjectOnNewEnemyHit":
        N.push({ id: v.abilityToInstantiate, Oa: v.chance || 1 });
        break;
      case "CreateAbilityObjectOnRicochet":
        C.push({ id: v.abilityToInstantiate });
        break;
      case "MineTrigger":
        G.push({ id: v.ability, delay: v.castDelay });
        break;
      case "FormChanger":
        v.transformReplacementSkill &&
          I.push({ id: v.transformReplacementSkill });
        $.each(v.transformAbilityList, function (L, R) {
          I.push({ id: R });
        });
        break;
      case "SummonEntityOnDeath":
        (x = le_Wb(v))
          ? z.push(x)
          : console.error("entityId not found for " + a.id);
        break;
      case "BuffParent":
        (x = le_Xb(v)) && m.push(x);
        break;
      case "TransformSkillBuffParent":
        (x = le_Xb(v)) && m.push(x);
        break;
      case "BuffCreator":
        (x = le_Yb(v)) && m.push(x);
        break;
      case "BuffCreatorOnDeath":
        (x = le_Zb(v)) && m.push(x);
        break;
      case "BuffCreatorOnDeathPerHit":
        (x = le__b(v)) && m.push(x);
        break;
      case "BuffCreatorAfterDuration":
        (x = le_0b(v)) && m.push(x);
        break;
      case "BuffOnEnemyHit":
        (x = le_1b(v)) && m.push(x);
        break;
      case "BuffOnAllyHit":
        (x = le_2b(v)) && m.push(x);
        break;
      case "RepeatedlyBuffInRadius":
        (x = le_3b(v)) && m.push(x);
        break;
      case "BuffCreatorOnCreation":
        (x = le_4b(v)) && m.push(x);
        break;
      case "HealParent":
        (x = le_5b(v)) && p.push(x);
        break;
      case "HealAlliesOnHit":
        v.healAmount &&
          le_.t("skills.skill_card.heal_allies", { value: le_j(v.healAmount) });
        break;
      case "RepeatedlyHealAlliesWithinRadius":
        (x = le_6b(v)) && p.push(x);
        break;
      case "PullEnemiesAfterCollision":
        (x = le_7b(v, c)) && r.push(x);
        break;
      case "RepeatedlyPullEnemiesWithinRadius":
        (x = le_8b(v, c)) && r.push(x);
        break;
      case "TransformBackToHumanOnDeath":
        (x = le_9b(v)) && r.push(x);
        break;
      case "KnockBackOnHit":
        (x = le_$b(v, c)) && r.push(x);
        break;
      case "StunEnemyOnHit":
        (x = le_ac(v, c)) && r.push(x);
        break;
      case "FreezeEnemyOnHit":
        (x = le_bc(v, c)) && r.push(x);
        break;
      case "TauntOnHit":
        (x = le_.t(
          "skills.skill_card.taunt",
          { secondsValue: v.duration },
          "mod-value"
        )) && r.push(x);
        break;
      case "PushEnemiesOnHit":
        (x = v.useRangeLimit
          ? le_.t(
              "skills.skill_card.push.in_range",
              { metersValue: v.rangeLimit },
              "mod-value"
            )
          : le_.t("skills.skill_card.push")) && r.push(x);
        break;
      case "FearNearbyEnemies":
        (x = le_.t(
          "skills.skill_card.fear.in_range",
          { metersValue: v.range },
          "mod-value"
        )) && r.push(x);
        break;
      case "Pierce":
        (x = le_cc(v)) && r.push(x);
        break;
      case "RicochetMovement":
        (x = le_dc(v, c)) && r.push(x);
        break;
      case "SendEnemiesForwardInTimeOnHit":
        (x = le_ec(v)) && r.push(x);
        break;
      case "ReturnCasterToOlderPosition":
        (x = le_fc(v)) && r.push(x);
        break;
      case "MoveCreatorToTargetOnDeath":
        (x = le_.t("skills.skill_card.teleport_to_position")) && r.push(x);
        break;
      case "ExchangeParentAndCreatorLocationOnDeath":
        (x = le_.t("skills.skill_card.exchange_positions")) && r.push(x);
        break;
      case "DamageCreatorOnCreation":
        (x = le_gc(v)) && r.push(x);
        break;
      case "CreatorTakesDamageOnSkillUse":
        (x = le_hc(v, c)) && r.push(x);
        break;
      case "ExtraProjectiles":
        (x = le_ic(v, f, c)) && r.push(x);
        break;
      case "HomingMovement":
        d || ((x = le_jc(v)) && r.push(x));
        break;
      case "CreateResourceReturnAbilityObjectOnEnemyHit":
        (x = le_kc(v, c)) && r.push(x);
        break;
      case "GiveCreatorResourcesOnHit":
        (x = le_lc(v, c)) && r.push(x);
        break;
      case "GiveCreatorResourcesOnStart":
        (x = le_mc(v, c)) && r.push(x);
        break;
      case "GiveCreatorResourcesOnDeath":
        (x = le_nc(v, c)) && r.push(x);
        break;
      case "GiveResourcesOnHit":
        (x = le_oc(v, c)) && r.push(x);
        break;
      case "RepeatedlyGiveParentResources":
        (x = le_pc(v, c)) && r.push(x);
        break;
      case "RepeatedlyGiveCreatorResources":
        (x = le_pc(v, c)) && r.push(x);
        break;
      case "CreateResourceReturnAbilityObjectsForCorpsesInArea":
        (x = le_qc(v, c)) && r.push(x);
        break;
      case "HitsTargets":
        (x = le_rc(v, c)) && r.push(x);
        break;
      case "RepeatedlyHitsTargets":
        (x = le_sc(v, c)) && r.push(x);
        break;
      case "AcceleratingHealthDrain":
        (x = le_.t("skills.skill_card.lose_health_over_time")) && r.push(x);
        break;
      case "MinionUsesAbilityOnStart":
        (x = le_tc(v, a)) && w.push(x);
        break;
      case "CastAtCorpseOnKill":
        (x = le_uc(v, a)) && w.push(x);
        break;
      case "CullFrozenTargetsOnHit":
        (x = le_vc(v, a)) && w.push(x);
        break;
      case "RetaliateWhenParentHit":
        (x = le_wc(v, c, a)) && w.push(x);
        break;
      case "KillSelf":
        break;
      case "MoveCreatorToPositionOnDeath":
        break;
      case "RepeatedlyAbsorbMinion":
        break;
      case "GiveCreatorResourcesOnCollisionWithCreator":
        break;
      case "CleanseAilmentsOnDeath":
        break;
      case "Stance":
        break;
      case "ExitStance":
      case "DestroyAfterDuration":
      case "DestroyAfterDurationScaledWithStat":
        break;
      default:
        console.warn("not handled", v.type);
    }
  });
  $.each(a.comboAbilities, function (x, v) {
    H.push({ id: v });
  });
  return {
    Fd: k,
    Bd: n,
    Cd: m,
    Pd: p,
    Jd: r,
    he: w,
    Qc: z,
    Te: N,
    Xe: C,
    df: I,
    Ad: G,
    oe: H,
  };
}
function le_xc(a, b, c, d, f) {
  b = le_Nb(b, b.prefab.components, c);
  let k = [];
  const n = [];
  $.each(b.Fd, function (m, p) {
    n.push([p]);
  });
  n.push(b.Bd);
  $.each(b.Cd, function (m, p) {
    n.push([p]);
  });
  n.push(b.Pd);
  n.push(b.Jd);
  n.push(b.he);
  $.each(n, function (m, p) {
    0 < p.length &&
      k.push(
        '<div class="ability-params">' +
          p.join('<div class="separator"></div>') +
          "</div>"
      );
  });
  if (0 < b.Qc.length) {
    let m = "";
    0 < k.length && (m = " with-divider");
    k.push(
      '<div class="ability-params' +
        m +
        '"><div>' +
        le_.t("skills.skill_card.summon") +
        '</div><div class="ability-param-group">' +
        b.Qc.join('<div class="separator"></div>') +
        "</div></div>"
    );
  }
  $.each(b.Ad, function (m, p) {
    (m = LEAbilities.abilityList[p.id]) &&
      le_v(p.id) &&
      !f &&
      ((p = le_xc(a, m, c, d, !0)), (k = k.concat(p)));
  });
  return k;
}
function le_yc(a) {
  const b = le_zc(a.attributeScaling);
  a = le_Ac(a.levelScaling);
  return b.concat(a).join("");
}
function le_Bc(a) {
  if (null != LEAbilities.invocations) {
    var b = Object.values(LEAbilities.invocations)[0][a];
    if (b)
      return (
        (a = Object.keys(LEAbilities.invocations)[0]),
        (a = le_w(LEAbilities.abilityList[a], null)),
        (b = le_Cc(b)),
        `<div class="invocation-ref">${a}${'<div class="rune-divider">-</div>'}${b}</div>`
      );
  }
  if (
    !window.classSkillSources ||
    !window.masterySkillSources ||
    !window.classInfoForSources
  )
    return null;
  b = [];
  var c = window.classSkillSources[a];
  if (c) {
    var d = c.reqCharLevel || 1;
    c = window.classInfoForSources[c.classId].characterClass;
    null != c.classNameKey
      ? ((c = le_b(c.classNameKey)), (c = le_Ra(c, !1)))
      : (c = c.className);
    b.push(
      le_.t(
        "skills.sources.class_skill_level",
        { className: c, level: d },
        "ability-source-class"
      )
    );
  }
  if ((c = window.masterySkillSources[a]))
    (a = c.reqLevel || 1),
      (d = c.reqMastery),
      (c = le_Pa(c.classId, c.mastery, !1)),
      d
        ? b.push(
            le_.t(
              "skills.sources.mastery_skill",
              { masteryName: c },
              "ability-source-class"
            )
          )
        : b.push(
            le_.t(
              "skills.sources.class_skill_level",
              { className: c, level: a },
              "ability-source-class"
            )
          );
  return b.join("");
}
function le_Db(a) {
  return a.abilitySprite
    ? "icons icons-" + a.abilitySprite.substr(2)
    : "ability-icon-none";
}
function le_Dc(a, b, c) {
  const d = le_Jb();
  var f = b.manaCost,
    k = b.channelCost;
  if (null != d.ie) var n = d.ie;
  else {
    n = b.chargesGainedPerSecond;
    var m = b.maxCharges || 0;
    0 != m && n && (m = 1 / n);
    n = 0 != m ? Math.round(100 * m) / 100 : 0;
  }
  m = n;
  null != skillBonuses[b.id] && (b.channelled && (k = 0), (f = b.manaCost));
  n = [];
  n.push(le_.t("skills.skill_card.mana_cost") + " " + le_k(le_j(f)));
  k &&
    ((f = le_.t("skills.skill_card.channel_cost.per_second", {
      value: le_j(k),
    })),
    n.push(le_.t("skills.skill_card.channel_cost") + " " + le_k(f)));
  n.push(le_.t("skills.skill_card.cooldown") + " " + le_k(le_l(m)));
  c = (b.speedMultiplier || 1) * (c || (0.75 / b.useDuration) * 1.46667);
  c = Math.round(1e3 * c) / 1e3;
  f = le_.t("skills.skill_card.base_speed.per_second", { value: le_j(c) });
  c = [];
  c.push(le_.t("skills.skill_card.base_speed") + " " + le_k(f));
  f = le_.t("skills.skill_card.use_delay") + " " + le_k(le_l(b.useDelay));
  k = le_.t("skills.skill_card.use_duration") + " " + le_k(le_l(b.useDuration));
  c.push(
    '<div class="ability-param-group" style="color:#e3d6b5;font-size:0.85em;"><div>' +
      f +
      "</div><div>" +
      k +
      '</div></div><div class="stat-extra" style="font-size:1em">' +
      a.jd(d.jd(b)) +
      "</div>"
  );
  a = "";
  b.instantCastForPlayer &&
    (a =
      '<div class="separator"></div><div class="stat-text">' +
      le_.t("skills.skill_card.instant_cast") +
      "</div>");
  return (
    n.join("<br/>") + '<div class="separator"></div>' + c.join("<br/>") + a
  );
}
function le_Ec(a) {
  const b = [];
  b.push(
    le_.t("minions.minion_card.skill_range") +
      " " +
      le_k(le_cb(a.minRange, a.maxRange))
  );
  b.push(
    le_.t("minions.minion_card.skill_engage_range") +
      " " +
      le_k(le_m(a.engageRange))
  );
  b.push(
    le_.t("minions.minion_card.skill_pursuit_range") +
      " " +
      le_k(le_m(a.persuitRange))
  );
  return b.join("<br/>");
}
function le_Fc(a) {
  const b = [];
  if (a.increasedDamage) {
    var c = le_.t("minions.minion_card.skill_mods.increased_damage", {
      value: le_i(a.increasedDamage),
    });
    b.push(le_k(c));
  }
  a.increasedCastSpeed &&
    ((c = le_.t("minions.minion_card.skill_mods.increased_cast_speed", {
      value: le_i(a.increasedCastSpeed),
    })),
    b.push(le_k(c)));
  a.addedCritChance &&
    ((c = le_.t("minions.minion_card.skill_mods.added_crit_chance", {
      value: le_i(a.addedCritChance),
    })),
    b.push(le_k(c)));
  a.addedFreezeRate &&
    ((c = le_.t("minions.minion_card.skill_mods.added_freeze_rate", {
      value: le_j(a.addedFreezeRate),
    })),
    b.push(le_k(c)));
  a.increasedFreezeRate &&
    ((c = le_.t("minions.minion_card.skill_mods.increased_freeze_rate", {
      value: le_i(a.increasedFreezeRate),
    })),
    b.push(le_k(c)));
  a.increasedProjectileSpeed &&
    ((c = le_.t("minions.minion_card.skill_mods.increased_projectile_speed", {
      value: le_i(a.increasedProjectileSpeed),
    })),
    b.push(le_k(c)));
  a.extraProjectiles &&
    ((c = le_.t("minions.minion_card.skill_mods.extra_projectiles", {
      value: le_j(a.extraProjectiles),
    })),
    b.push(le_k(c)));
  a.increasedDuration &&
    ((c = le_.t("minions.minion_card.skill_mods.increased_duration", {
      value: le_i(a.increasedDuration),
    })),
    b.push(le_k(c)));
  a.increasedRadius &&
    ((c = le_.t("minions.minion_card.skill_mods.increased_radius", {
      value: le_i(a.increasedRadius),
    })),
    b.push(le_k(c)));
  a.pierceChance &&
    ((a = le_.t("minions.minion_card.skill_mods.pierce_chance", {
      value: le_i(a.pierceChance),
    })),
    b.push(le_k(a)));
  return b.join("<br/>");
}
function le_y(a) {
  return a ? '<div class="stat-extra">' + a + "</div>" : "";
}
function le_Ob(a, b) {
  const c = [];
  $.each(a, function (d, f) {
    c.push("<div>" + f + "</div>");
  });
  a = "";
  b && (a = '<div class="damage-extra">' + b + "</div>");
  return (
    "<div>" +
    le_.t("skills.base.damage") +
    "</div>" +
    a +
    '<div class="ability-param-group">' +
    c.join("") +
    "</div>"
  );
}
function le_Pb(a, b) {
  let c = le_.t("skills.skill_card.damage_on_rotate", {
    value: le_i(a.damageModifierPerDegree, !0),
  });
  b &&
    ((b = []),
    b.push(
      le_.t("skills.skill_card.damage_on_rotate.update_rate") +
        " " +
        le_l(a.updateInterval)
    ),
    b.push(
      le_.t("skills.skill_card.damage_on_rotate.reset_rate") +
        " " +
        le_l(a.resetInterval)
    ),
    0 < b.length && (c += le_y(b.join("<br/>"))));
  return c;
}
function le_Qb(a) {
  let b;
  0 < a.damageIncreasePerHit
    ? (b = le_.t("skills.skill_card.more_damage_on_subsequent_hit", {
        value: le_i(a.damageIncreasePerHit),
        maxValue: le_i(a.maximumTotalChange),
      }))
    : 0 > a.damageIncreasePerHit &&
      (b = le_.t("skills.skill_card.less_damage_on_subsequent_hit", {
        value: le_i(a.damageIncreasePerHit),
        maxValue: le_i(a.maximumTotalChange),
      }));
  return b;
}
function le_Rb(a) {
  const b = LEAbilities.ailmentList[a.ailment];
  return !b || -100 > a.chance ? null : b;
}
function le_Sb(a) {
  switch (a) {
    case 0:
      return "skills.skill_card.ailment_chance.target.to_enemies";
    case 1:
      return "skills.skill_card.ailment_chance.target.to_allies";
    case 2:
      return "skills.skill_card.ailment_chance.target.to_enemies_and_allies";
    case 3:
      return "skills.skill_card.ailment_chance.target.to_enemies_and_minions";
    case 4:
      return "skills.skill_card.ailment_chance.target.to_non_minion_allies";
    case 5:
      return "skills.skill_card.ailment_chance.target.to_ally_minions";
    case 6:
      return "skills.skill_card.ailment_chance.target.to_enemy_minions";
    case 7:
      return "skills.skill_card.ailment_chance.target.to_ally_totems";
  }
}
function le_Tb(a) {
  const b = [];
  0 != a.increasedDuration &&
    b.push(
      le_.t("skills.skill_card.ailment_chance.increased_duration", {
        value: le_i(a.increasedDuration),
      })
    );
  0 != a.increasedEffect &&
    b.push(
      le_.t("skills.skill_card.ailment_chance.increased_effect", {
        value: le_i(a.increasedEffect),
      })
    );
  return 0 < b.length ? le_y("(" + b.join("<br/>") + ")") : "";
}
function le_Ub(a) {
  switch (a) {
    case 0:
      return "skills.skill_card.ailment_chance.in_radius.to_everyone";
    case 1:
      return "skills.skill_card.ailment_chance.in_radius.to_allies";
    case 2:
      return "skills.skill_card.ailment_chance.in_radius.to_enemies";
    case 3:
      return "skills.skill_card.ailment_chance.in_radius.to_your_minions";
    case 4:
      return "skills.skill_card.ailment_chance.in_radius.to_your_companions";
    case 5:
      return "skills.skill_card.ailment_chance.in_radius.to_yourself";
    case 6:
      return "skills.skill_card.ailment_chance.in_radius.to_all_minions";
    case 7:
      return "skills.skill_card.ailment_chance.in_radius.to_all_companions";
    case 8:
      return "skills.skill_card.ailment_chance.in_radius.to_your_summoners";
    case 9:
      return "skills.skill_card.ailment_chance.in_radius.to_allies_not_yourself";
  }
}
function le_Vb(a) {
  const b = [];
  $.each(a.ailmentsToSpread, function (c, d) {
    (c = LEAbilities.ailmentList[d]) && b.push(le_x(c));
  });
  if (0 < b.length) {
    a: {
      switch (a.targetType) {
        case 0:
          a = "skills.skill_card.ailment_spread.target.to_enemies";
          break a;
        case 1:
          a = "skills.skill_card.ailment_spread.target.to_allies";
          break a;
        case 2:
          a = "skills.skill_card.ailment_spread.target.to_enemies_and_allies";
          break a;
      }
      a = void 0;
    }
    a = le_.t(a, { ailmentName: b.join(", ") });
  } else a = "";
  return a;
}
function le_Wb(a) {
  const b = LEAbilities.entityList[a.entity];
  if (b) {
    var c = le_j(a.numberToSummon + " x") + " ";
    var d = b.actor.data
      ? '<a href="#" class="entity-link" entity_id="' +
        b.id +
        '" section_entity_id="' +
        b.actor.data.genId +
        '">' +
        le_Gc(b) +
        "</a>"
      : '<a href="#" class="entity-link" entity_id="' +
        b.id +
        '">' +
        le_Gc(b) +
        "</a>";
    c += '<div class="entity-icon-name no-icon">' + d + "</div>";
    d = [];
    a.limitNumber &&
      d.push(le_.t("skills.skill_card.summon_limit") + " " + le_j(a.limit));
    var f = null;
    a.limitDuration
      ? 1e4 > a.duration && (f = a.duration)
      : b.timeUntilDeath && (f = b.timeUntilDeath);
    null != f &&
      d.push(le_.t("skills.skill_card.summon_duration") + " " + le_l(f));
    0 < d.length && (c += le_y(d.join("<br/>")));
    return c;
  }
}
function le_Xb(a) {
  let b = [];
  $.each(a.stats, function (f, k) {
    b = b.concat($db.formatBuff(k, $db.Nb()));
  });
  if (a.increasedSize) {
    var c = le_.t("skills.skill_card.buff.creature_increased_size", {
      value: le_i(a.increasedSize),
    });
    b.push(c);
  }
  a.ward &&
    ((c = le_.t("skills.skill_card.buff.gain_ward", { value: le_j(a.ward) })),
    b.push(c));
  a.wardRegen &&
    ((c = le_.t("skills.skill_card.buff.gain_ward_regen", {
      value: le_j(a.wardRegen),
    })),
    b.push(c));
  const d = [];
  a.forceZeroWard &&
    d.push(
      '<div class="buff-condition">' +
        le_.t("skills.skill_card.buff.zero_ward") +
        "</div>"
    );
  a.cantGainWard &&
    d.push(
      '<div class="buff-condition">' +
        le_.t("skills.skill_card.buff.no_ward_gain") +
        "</div>"
    );
  a.cantHeal &&
    d.push(
      '<div class="buff-condition">' +
        le_.t("skills.skill_card.buff.no_heal") +
        "</div>"
    );
  a.capHealthAtCurrent &&
    d.push(
      '<div class="buff-condition">' +
        le_.t("skills.skill_card.buff.health_capped_at_current") +
        "</div>"
    );
  a.scalesWithAreaLevel &&
    d.push(
      '<div class="buff-condition">' +
        le_.t("skills.skill_card.buff.scales_with_area_level") +
        "</div>"
    );
  a.onlyApplyToMinions &&
    d.push(
      '<div class="buff-condition">' +
        le_.t("skills.skill_card.buff.only_apply_to_minion") +
        "</div>"
    );
  $.each(b, function (f, k) {
    d.push('<div class="buff">' + k + "</div>");
  });
  return le_z(d);
}
function le_Yb(a) {
  a = le_Hc(a);
  return le_z(a);
}
function le_Zb(a) {
  a = le_Hc(a);
  return le_z(a);
}
function le__b(a) {
  a = le_Hc(a);
  return le_z(a);
}
function le_0b(a) {
  const b = a.interval,
    c = a.maxSteps,
    d = a.buffAtStart;
  let f;
  0 >= c
    ? (f = le_.t(
        "skills.skill_card.buff.in_radius.apply_interval",
        { secondsValue: b },
        "mod-value"
      ))
    : 1 == c
    ? d
      ? (f = "")
      : (f = le_.t(
          "skills.skill_card.buff.in_radius.apply_after",
          { secondsValue: b },
          "mod-value"
        ))
    : (f = le_.t(
        "skills.skill_card.buff.in_radius.apply_interval.with_limit",
        { secondsValue: b, timesValue: c },
        "mod-value"
      ));
  a = le_Hc(a);
  return le_z(a, f);
}
function le_1b(a) {
  var b = le_Ic(a.buffs);
  a = le_Jc(a.buffs, 1 != b.length);
  b =
    1 == b.length
      ? le_.t(
          "skills.skill_card.buff.target.to_enemies.for_duration",
          { secondsValue: b[0] },
          "mod-value"
        )
      : le_.t("skills.skill_card.buff.target.to_enemies");
  return le_z(a, b);
}
function le_2b(a) {
  var b = le_Ic(a.buffs);
  const c = le_Jc(a.buffs, 1 != b.length);
  b =
    1 == b.length
      ? le_.t(
          "skills.skill_card.buff.target.to_allies.for_duration",
          { secondsValue: b[0] },
          "mod-value"
        )
      : le_.t("skills.skill_card.buff.target.to_allies");
  const d = [];
  d.push(b);
  a.canApplyToSameAllyAgain &&
    d.push(le_.t("skills.skill_card.buff.in_radius.can_apply_again"));
  return le_z(c, d.join("<br/>"));
}
function le_3b(a) {
  var b = le_Ic(a.buffs);
  const c = le_Jc(a.buffs, 1 != b.length);
  b =
    1 == b.length
      ? le_.t(
          le_Kc(a.targetType),
          { metersValue: a.radius, secondsValue: b[0] },
          "mod-value"
        )
      : le_.t(le_Lc(a.targetType), { metersValue: a.radius }, "mod-value");
  const d = [];
  d.push(b);
  d.push(
    le_.t(
      "skills.skill_card.buff.in_radius.apply_interval",
      { secondsValue: a.applicationInterval },
      "mod-value"
    )
  );
  return le_z(c, d.join("<br/>"));
}
function le_4b(a) {
  var b = le_Ic(a.buffs);
  a = le_Jc(a.buffs, 1 != b.length);
  b =
    1 == b.length
      ? le_.t(
          "skills.skill_card.buff.target.to_yourself.for_duration",
          { secondsValue: b[0] },
          "mod-value"
        )
      : le_.t("skills.skill_card.buff.target.to_yourself");
  return le_z(a, b);
}
function le_5b(a) {
  const b = [];
  a.healInterval &&
    a.healAmount &&
    b.push(
      le_.t("skills.skill_card.heal.repeatedly", {
        value: le_j(a.healAmount),
        secondsValue: a.healInterval,
      })
    );
  if (
    a.healAmountOnStart &&
    (b.push(
      le_.t("skills.skill_card.heal", { value: le_j(a.healAmountOnStart) })
    ),
    a.modifierForCreatorMinions)
  ) {
    const c = le_.t("skills.skill_card.heal.for_minions", {
      value: le_j(a.healAmountOnStart),
    });
    b.push(le_y(c));
  }
  a.wardAmountOnStart &&
    b.push(
      le_.t("skills.skill_card.gain_ward", { value: le_j(a.wardAmountOnStart) })
    );
  return b.join("<br/>");
}
function le_6b(a) {
  const b = [];
  a.healAmount &&
    b.push(
      le_.t(
        "skills.skill_card.heal_allies.repeatedly_in_area",
        {
          metersValue: a.radius,
          value: le_j(Math.round((a.healAmount / a.interval) * 100) / 100),
        },
        "mod-value"
      )
    );
  a.manaAmount &&
    b.push(
      le_.t(
        "skills.skill_card.heal_allies.repeatedly_in_area.mana",
        {
          metersValue: a.radius,
          value: le_j(Math.round((a.manaAmount / a.interval) * 100) / 100),
        },
        "mod-value"
      )
    );
  return b.join("<br/>");
}
function le_7b(a, b) {
  let c;
  c = le_.t("skills.skill_card.pull");
  b &&
    a.useRangeLimit &&
    ((a = le_.t("skills.skill_card.pull.range") + " " + le_m(a.rangeLimit)),
    (c += le_y(a)));
  return c;
}
function le_8b(a, b) {
  let c;
  c =
    0 == a.minimumRadius || a.minimumRadius == a.radius
      ? le_.t(
          "skills.skill_card.pull.in_radius",
          { metersValue: a.radius },
          "mod-value"
        )
      : le_.t(
          "skills.skill_card.pull.in_radius.range",
          { minMetersValue: a.minimumRadius, maxMetersValue: a.radius },
          "mod-value"
        );
  b &&
    ((a = le_.t("skills.base.damage.interval") + " " + le_l(a.interval)),
    (c += le_y(a)));
  return c;
}
function le_9b(a) {
  let b;
  a.manaRegained &&
    (b = le_.t("skills.skill_card.gain_mana_on_transform_back", {
      value: le_j(a.manaRegained),
    }));
  return b;
}
function le_$b(a, b) {
  let c;
  c =
    0 != a.chance
      ? le_.t("skills.skill_card.knockback.chance", { value: le_i(a.chance) })
      : le_.t("skills.skill_card.knockback");
  b &&
    ((a =
      le_.t("skills.skill_card.knockback.distance") + " " + le_m(a.distance)),
    (c += le_y(a)));
  return c;
}
function le_ac(a, b) {
  let c;
  c = le_.t(
    "skills.skill_card.stun",
    { secondsValue: a.duration },
    "mod-value"
  );
  b &&
    a.useDifferentDurationForRareAndBoss &&
    ((a = le_.t(
      "skills.skill_card.rare_and_boss",
      { secondsValue: a.rareAndBossDuration },
      "mod-value"
    )),
    (c += le_y(a)));
  return c;
}
function le_bc(a, b) {
  let c;
  c = a.timeLockInstead
    ? le_.t(
        "skills.skill_card.time_lock",
        { secondsValue: a.duration },
        "mod-value"
      )
    : le_.t(
        "skills.skill_card.freeze",
        { secondsValue: a.duration },
        "mod-value"
      );
  b &&
    a.ignoreImmunity &&
    ((a =
      1 == a.ignoreImmunity
        ? le_.t("skills.skill_card.freeze.ignore_immunity")
        : void 0),
    (c += le_y(a)));
  return c;
}
function le_cc(a) {
  switch (a.pierceStyle) {
    case 0:
      0 < a.objectsToPierce &&
        le_.t(
          "skills.skill_card.pierce.multiple",
          { targetsValue: a.objectsToPierce },
          "mod-value"
        );
      break;
    case 1:
      0 < a.pierceChance &&
        le_.t(
          "skills.skill_card.pierce.chance",
          { chanceValue: le_i(a.pierceChance) },
          "mod-value"
        );
      break;
    case 2:
      0 < a.objectsToPierce &&
        0 < a.pierceChance &&
        le_.t(
          "skills.skill_card.pierce.multiple.chance",
          {
            chanceValue: le_i(a.pierceChance),
            targetsValue: a.objectsToPierce,
          },
          "mod-value"
        );
  }
}
function le_dc(a, b) {
  a: {
    switch (a.targetType) {
      case 0:
        var c = "skills.skill_card.ricochet.to_enemies";
        break a;
      case 1:
        c = "skills.skill_card.ricochet.to_allies";
        break a;
      case 2:
        c = "skills.skill_card.ricochet.to_targets";
        break a;
    }
    c = void 0;
  }
  a.returnToCasterAfterLastRicochet && (c = `${c}.and_return`);
  c = le_.t(c, { targetsValue: a.remainingRicochets }, "mod-value");
  b &&
    ((b = []),
    a.healthGainedOnRicochetHit &&
      b.push(
        le_.t("skills.skill_card.ricochet.gain_health", {
          value: a.healthGainedOnRicochetHit,
        })
      ),
    a.manaGainedOnRicochetHit &&
      b.push(
        le_.t("skills.skill_card.ricochet.gain_mana", {
          value: a.manaGainedOnRicochetHit,
        })
      ),
    a.wardGainedOnRicochetHit &&
      b.push(
        le_.t("skills.skill_card.ricochet.gain_ward", {
          value: a.wardGainedOnRicochetHit,
        })
      ),
    0 < b.length && (c += le_y(b.join("<br/>"))));
  return c;
}
function le_ec(a) {
  let b = le_.t(
    "skills.skill_card.send_forward_in_time",
    { secondsValue: a.duration },
    "mod-value"
  );
  a.excludeBossesAndMinibosses &&
    (b += le_y(
      le_.t("skills.skill_card.send_forward_in_time.no_effect_on_bosses")
    ));
  return b;
}
function le_fc(a) {
  let b = le_.t(
    "skills.skill_card.return_to_position",
    { secondsValue: a.positionAge },
    "mod-value"
  );
  a.restoreHealth && a.restoreMana
    ? (b +=
        ", " +
        le_.t("skills.skill_card.return_to_position.revert_health_and_mana"))
    : a.restoreHealth
    ? (b += ", " + le_.t("skills.skill_card.return_to_position.revert_health"))
    : a.restoreMana &&
      (b += ", " + le_.t("skills.skill_card.return_to_position.revert_mana"));
  return b;
}
function le_gc(a) {
  const b = [];
  a.percentCurrentHealthTaken &&
    b.push(
      le_.t("skills.skill_card.lose_percent_of_current_health", {
        value: le_i(a.percentCurrentHealthTaken),
      })
    );
  a.percentMaximumHealthTaken &&
    b.push(
      le_.t("skills.skill_card.lose_percent_of_max_health", {
        value: le_i(a.percentMaximumHealthTaken),
      })
    );
  a.flatDamage &&
    b.push(
      le_.t("skills.skill_card.lose_health", { value: le_j(a.flatDamage) })
    );
  return b.join("<br/>");
}
function le_hc(a, b) {
  var c = [];
  a.percentCurrentHealthTaken &&
    c.push(
      le_.t("skills.skill_card.lose_percent_of_current_health_on_skill_use", {
        value: le_j(a.flatDamage),
      })
    );
  a.flatHealthTaken &&
    c.push(
      le_.t("skills.skill_card.lose_health_on_skill_use", {
        value: le_j(a.flatHealthTaken),
      })
    );
  c = c.join("<br/>");
  b &&
    ((b = []),
    a.canKill
      ? b.push(le_.t("skills.skill_card.health_loss.can_kill"))
      : b.push(le_.t("skills.skill_card.health_loss.cant_kill")),
    0 < b.length && (c += le_y(b.join("<br/>"))));
  return c;
}
function le_ic(a, b, c) {
  var d = 1 + a.numberOfExtraProjectiles;
  b = b ? "fire_projectiles.homing" : "fire_projectiles";
  d = a.lineMode
    ? le_.t(`skills.skill_card.${b}.in_line`, { targetsValue: d }, "mod-value")
    : a.randomAngles
    ? le_.t(
        `skills.skill_card.${b}.in_arc.at_random_angles`,
        { targetsValue: d, angle: le_j(a.angle) },
        "mod-value"
      )
    : le_.t(
        `skills.skill_card.${b}.in_arc`,
        { targetsValue: d, angle: le_j(a.angle) },
        "mod-value"
      );
  c &&
    a.delayExtraProjectiles &&
    ((a = le_.t(
      a.randomiseDelay
        ? "skills.skill_card.fire_projectiles.delay.random"
        : "skills.skill_card.fire_projectiles.delay",
      { secondsValue: a.delayWindow },
      "mod-value"
    )),
    (d += le_y(a)));
  return d;
}
function le_jc(a) {
  switch (a.targetType) {
    case 0:
      return le_.t("skills.skill_card.homing.to_enemies");
    case 1:
      return le_.t("skills.skill_card.homing.to_allies");
    case 2:
      return le_.t("skills.skill_card.homing.to_everyone");
    case 3:
      return le_.t("skills.skill_card.homing.to_yourself");
  }
}
function le_kc(a, b) {
  let c = le_Mc(
    "return_resources.on_hit",
    a.health + a.addedHeathPerHit,
    a.mana + a.addedManaPerHit,
    a.ward + a.addedWardPerHit
  );
  if (c)
    return (
      b &&
        ((b = []),
        a.healthScalesWithIncreasedHealing &&
          b.push(le_.t("skills.skill_card.gain_resources.scales_with_healing")),
        a.doubleEffectChance &&
          b.push(
            le_.t("skills.skill_card.gain_resources.double_effect_chance", {
              value: le_i(a.doubleEffectChance),
            })
          ),
        a.limitProcs &&
          b.push(
            le_.t("skills.skill_card.gain_resources.proc_limit") +
              " " +
              le_j(a.maxProcs)
          ),
        0 < b.length && (c += le_y(b.join("<br/>")))),
      c
    );
}
function le_lc(a, b) {
  let c = le_Mc(
    "gain_resources.on_hit",
    a.healthOnHit,
    a.manaOnHit,
    a.wardOnHit
  );
  if (c) {
    var d = [];
    a.canHitSameAllyTwice &&
      d.push(le_.t("skills.skill_card.gain_resources.can_hit_twice.target"));
    b &&
      ((b = []),
      a.healthScalesWithIncreasedHealing &&
        b.push(le_.t("skills.skill_card.gain_resources.scales_with_healing")),
      a.limittedTimes &&
        b.push(
          le_.t(
            "skills.skill_card.gain_resources.hit_limit",
            { count: a.remainingTimes },
            "mod-value"
          )
        ),
      0 < b.length && (c += le_y(b.join("<br/>"))));
    return c;
  }
}
function le_mc(a, b) {
  let c = le_Mc("gain_resources.immediately", a.health, a.mana, a.ward);
  if (c)
    return (
      b &&
        ((b = []),
        a.healthScalesWithIncreasedHealing &&
          b.push(le_.t("skills.skill_card.gain_resources.scales_with_healing")),
        0 < b.length && (c += le_y(b.join("<br/>")))),
      c
    );
}
function le_nc(a, b) {
  let c = le_Mc("gain_resources.on_skill_end", a.health, a.mana, a.ward);
  if (c)
    return (
      b &&
        ((b = []),
        a.healthScalesWithIncreasedHealing &&
          b.push(le_.t("skills.skill_card.gain_resources.scales_with_healing")),
        0 < b.length && (c += le_y(b.join("<br/>")))),
      c
    );
}
function le_oc(a, b) {
  var c = a.healthOnHit;
  const d = a.manaOnHit,
    f = a.wardOnHit;
  let k;
  const n = [];
  a.onlyHitAllies
    ? ((k = "give_resources.on_hit.to_allies"),
      a.canHitSameAllyTwice &&
        n.push(le_.t("skills.skill_card.gain_resources.can_hit_twice.ally")))
    : a.canHitAllies
    ? ((k = "give_resources.on_hit.to_enemies_or_allies"),
      a.canHitSameAllyTwice &&
        n.push(le_.t("skills.skill_card.gain_resources.can_hit_twice.target")))
    : ((k = "give_resources.on_hit.to_enemies"),
      a.canHitSameEnemyTwice &&
        n.push(le_.t("skills.skill_card.gain_resources.can_hit_twice.enemy")));
  if ((c = le_Mc(k, c, d, f)))
    return (
      b &&
        ((b = []),
        a.healthScalesWithIncreasedHealing &&
          b.push(le_.t("skills.skill_card.gain_resources.scales_with_healing")),
        a.limittedTimes &&
          b.push(
            le_.t(
              "skills.skill_card.gain_resources.hit_limit",
              { count: a.remainingTimes },
              "mod-value"
            )
          ),
        0 < b.length && (c += le_y(b.join("<br/>")))),
      c
    );
}
function le_pc(a, b) {
  var c = a.health;
  const d = a.mana,
    f = a.ward;
  let k;
  k =
    0 >= a.maxApplications
      ? "gain_resources.repeatedly.apply_interval"
      : 1 == a.maxApplications
      ? a.applyOnStart
        ? "gain_resources.immediately"
        : "gain_resources.repeatedly.apply_after"
      : "gain_resources.repeatedly.apply_interval.with_limit";
  if (c && d && f)
    c = le_.t(
      `skills.skill_card.${k}.health_mana_ward`,
      {
        secondsValue: a.interval,
        timesValue: a.maxApplications,
        healthValue: c,
        manaValue: d,
        wardValue: f,
      },
      "mod-value"
    );
  else if (c && d)
    c = le_.t(
      `skills.skill_card.${k}.health_mana`,
      {
        secondsValue: a.interval,
        timesValue: a.maxApplications,
        healthValue: c,
        manaValue: d,
      },
      "mod-value"
    );
  else if (c && f)
    c = le_.t(
      `skills.skill_card.${k}.health_ward`,
      {
        secondsValue: a.interval,
        timesValue: a.maxApplications,
        healthValue: c,
        wardValue: f,
      },
      "mod-value"
    );
  else if (d && f)
    c = le_.t(
      `skills.skill_card.${k}.mana_ward`,
      {
        secondsValue: a.interval,
        timesValue: a.maxApplications,
        manaValue: d,
        wardValue: f,
      },
      "mod-value"
    );
  else if (c)
    c = le_.t(
      `skills.skill_card.${k}.health`,
      {
        secondsValue: a.interval,
        timesValue: a.maxApplications,
        healthValue: c,
      },
      "mod-value"
    );
  else if (d)
    c = le_.t(
      `skills.skill_card.${k}.mana`,
      { secondsValue: a.interval, timesValue: a.maxApplications, manaValue: d },
      "mod-value"
    );
  else if (f)
    c = le_.t(
      `skills.skill_card.${k}.ward`,
      { secondsValue: a.interval, timesValue: a.maxApplications, wardValue: f },
      "mod-value"
    );
  else return;
  b &&
    ((b = []),
    a.healthScalesWithIncreasedHealing &&
      b.push(le_.t("skills.skill_card.gain_resources.scales_with_healing")),
    0 < b.length && (c += le_y(b.join("<br/>"))));
  return c;
}
function le_qc(a, b) {
  var c = a.health;
  const d = a.mana,
    f = a.ward;
  if (c && d && f)
    c = le_.t(
      "skills.skill_card.gain_resources.from_corpse.health_mana_ward",
      { metersValue: a.radius, healthValue: c, manaValue: d, wardValue: f },
      "mod-value"
    );
  else if (c && d)
    c = le_.t(
      "skills.skill_card.gain_resources.from_corpse.health_mana",
      { metersValue: a.radius, healthValue: c, manaValue: d },
      "mod-value"
    );
  else if (c && f)
    c = le_.t(
      "skills.skill_card.gain_resources.from_corpse.health_ward",
      { metersValue: a.radius, healthValue: c, wardValue: f },
      "mod-value"
    );
  else if (d && f)
    c = le_.t(
      "skills.skill_card.gain_resources.from_corpse.mana_ward",
      { metersValue: a.radius, manaValue: d, wardValue: f },
      "mod-value"
    );
  else if (c)
    c = le_.t(
      "skills.skill_card.gain_resources.from_corpse.health",
      { metersValue: a.radius, healthValue: c },
      "mod-value"
    );
  else if (d)
    c = le_.t(
      "skills.skill_card.gain_resources.from_corpse.mana",
      { metersValue: a.radius, manaValue: d },
      "mod-value"
    );
  else if (f)
    c = le_.t(
      "skills.skill_card.gain_resources.from_corpse.ward",
      { metersValue: a.radius, wardValue: f },
      "mod-value"
    );
  else return;
  b &&
    ((b = []),
    a.healthScalesWithIncreasedHealing &&
      b.push(le_.t("skills.skill_card.gain_resources.scales_with_healing")),
    0 < b.length && (c += le_y(b.join("<br/>"))));
  return c;
}
function le_rc(a, b) {
  var c = 1 + a.extraTargets;
  if (1 != c || 0 != a.spreadType)
    return (
      (c = le_.t(
        a.targetAllies
          ? a.hitNearest && a.enemyMustBeCursed
            ? "skills.skill_card.hit.target.allies.nearest_cursed"
            : a.hitNearest
            ? "skills.skill_card.hit.target.allies.nearest"
            : a.hitNearest
            ? "skills.skill_card.hit.target.allies.cursed"
            : "skills.skill_card.hit.target.allies"
          : a.hitNearest && a.enemyMustBeCursed
          ? "skills.skill_card.hit.target.enemies.nearest_cursed"
          : a.hitNearest
          ? "skills.skill_card.hit.target.enemies.nearest"
          : a.hitNearest
          ? "skills.skill_card.hit.target.enemies.cursed"
          : "skills.skill_card.hit.target.enemies",
        { targetCount: c, metersValue: a.maxDistanceFromCentre },
        "mod-value"
      )),
      b &&
        ((b = []),
        (a = le_Nc(a.spreadType, a.spreadRange)) && b.push(a),
        0 < b.length && (c += le_y(b.join("<br/>")))),
      c
    );
}
function le_sc(a, b) {
  let c = le_.t(
    a.targetAllies
      ? a.hitNearest
        ? "skills.skill_card.repeatedly_hit.target.allies.nearest"
        : "skills.skill_card.repeatedly_hit.target.allies"
      : a.hitNearest
      ? "skills.skill_card.repeatedly_hit.target.enemies.nearest"
      : "skills.skill_card.repeatedly_hit.target.enemies",
    { targetCount: a.maxTargets, metersValue: a.maxDistanceFromCentre },
    "mod-value"
  );
  b &&
    ((b = []),
    b.push(le_.t("skills.base.damage.interval") + " " + le_l(a.interval)),
    (a = le_Nc(a.spreadType, a.spreadRange)) && b.push(a),
    0 < b.length && (c += le_y(b.join("<br/>"))));
  return c;
}
function le_tc(a, b) {
  const c = LEAbilities.abilityList[a.ability];
  if (c && le_v(a.ability))
    return (
      (a = le_w(c, b)),
      le_.t("skills.skill_card.minion_uses_skill", { skillName: a })
    );
}
function le_uc(a, b) {
  let c;
  const d = LEAbilities.abilityList[a.abilityToCast];
  d &&
    le_v(a.abilityToCast) &&
    ((b = le_w(d, b)),
    (c =
      0 != a.chance
        ? le_.t("skills.skill_card.cast_at_corpse_on_kill.chance", {
            skillName: b,
            chanceValue: le_i(a.chance),
          })
        : le_.t("skills.skill_card.cast_at_corpse_on_kill", { skillName: b })));
  return c;
}
function le_vc(a, b) {
  const c = [];
  0 != a.flatCullThreshold
    ? c.push(
        le_.t("skills.skill_card.cull_target", {
          value: le_j(a.flatCullThreshold),
        })
      )
    : 0 != a.percentageCullThreshold &&
      c.push(
        le_.t("skills.skill_card.cull_target", {
          value: le_i(a.percentageCullThreshold),
        })
      );
  const d = LEAbilities.abilityList[a.onCullAbility];
  d &&
    le_v(a.onCullAbility) &&
    ((a = le_w(d, b)),
    c.push(le_.t("skills.skill_card.cast_on_cull_target", { skillName: a })));
  return c.join("<br/>");
}
function le_wc(a, b, c) {
  const d = LEAbilities.abilityList[a.ability];
  if (d && le_v(a.ability)) {
    var f = le_w(d, c);
    f =
      0 != a.chanceBasedRetaliation
        ? le_.t("skills.skill_card.retaliate.chance", {
            skillName: f,
            damageValue: le_j(a.damageTakenTrigger),
            chanceValue: le_i(
              a.retaliationChance * (1 + a.chanceModifierForAllies)
            ),
          })
        : le_.t("skills.skill_card.retaliate", {
            skillName: f,
            damageValue: le_j(a.damageTakenTrigger),
          });
    b &&
      ((b = []),
      a.limitRetaliations &&
        b.push(
          le_.t("skills.skill_card.retaliate_limit") +
            " " +
            le_j(a.retaliationsRemaining)
        ),
      0 < b.length && (f += le_y(b.join("<br/>"))));
  }
  return f;
}
function le_z(a, b) {
  if (0 < a.length) {
    let c = "";
    b && (c = '<div class="stat-extra">' + b + "</div>");
    return (
      "<div>" +
      le_.t("skills.skill_card.buffs") +
      "</div>" +
      c +
      '<div class="ability-param-group">' +
      a.join("") +
      "</div>"
    );
  }
  return null;
}
function le_Ic(a) {
  const b = [];
  $.each(a, function (c, d) {
    b.push(d.remainingDuration);
  });
  return le_Oc(b);
}
function le_Jc(a, b) {
  const c = [];
  $.each(a, function (d, f) {
    let k = "";
    b &&
      (k = le_.t(
        "skills.skill_card.buff.in_radius.buff_duration",
        { secondsValue: f.remainingDuration },
        "mod-value"
      ));
    d = $db.formatBuff(f.stat, $db.Nb());
    $.each(d, function (n, m) {
      c.push('<div class="buff">' + m + k + "</div>");
    });
  });
  return c;
}
function le_Kc(a) {
  switch (a) {
    case 0:
      return "skills.skill_card.buff.in_radius.to_everyone.for_duration";
    case 1:
      return "skills.skill_card.buff.in_radius.to_allies.for_duration";
    case 2:
      return "skills.skill_card.buff.in_radius.to_enemies.for_duration";
    case 3:
      return "skills.skill_card.buff.in_radius.to_your_minions.for_duration";
    case 4:
      return "skills.skill_card.buff.in_radius.to_your_companions.for_duration";
    case 5:
      return "skills.skill_card.buff.in_radius.to_yourself.for_duration";
  }
}
function le_Lc(a) {
  switch (a) {
    case 0:
      return "skills.skill_card.buff.in_radius.to_everyone";
    case 1:
      return "skills.skill_card.buff.in_radius.to_allies";
    case 2:
      return "skills.skill_card.buff.in_radius.to_enemies";
    case 3:
      return "skills.skill_card.buff.in_radius.to_your_minions";
    case 4:
      return "skills.skill_card.buff.in_radius.to_your_companions";
    case 5:
      return "skills.skill_card.buff.in_radius.to_yourself";
  }
}
function le_Hc(a) {
  let b = [];
  $.each(a.stats, function (f, k) {
    b = b.concat($db.formatBuff(k, $db.Nb()));
  });
  if (a.increasedSize) {
    var c = le_.t("skills.skill_card.buff.creature_increased_size", {
      value: le_i(a.increasedSize),
    });
    b.push(c);
  }
  a.lifeRegen &&
    ((c = le_.t(
      "skills.skill_card.buff.skills.skill_card.buff.gain_health_regen",
      { value: le_j(a.lifeRegen) }
    )),
    b.push(c));
  a.ward &&
    ((c = le_.t("skills.skill_card.buff.gain_ward", { value: le_j(a.ward) })),
    b.push(c));
  a.wardRegen &&
    ((c = le_.t("skills.skill_card.buff.gain_ward_regen", {
      value: le_j(a.wardRegen),
    })),
    b.push(c));
  const d = [];
  a.onlyApplyToCreatorMinions &&
    d.push(
      '<div class="buff-condition">' +
        le_.t("skills.skill_card.buff.only_apply_to_minion") +
        "</div>"
    );
  $.each(b, function (f, k) {
    d.push('<div class="buff">' + k + "</div>");
  });
  return d;
}
function le_Nc(a, b) {
  let c = "";
  switch (a) {
    case 1:
      c = le_.t("skills.skill_card.hit.spread.chains") + " " + le_m(b);
      break;
    case 2:
      c = le_.t("skills.skill_card.hit.spread.forks") + " " + le_m(b);
      break;
    case 3:
      c = le_.t("skills.skill_card.hit.spread.chains_forks") + " " + le_m(b);
      break;
    case 4:
      c = le_.t("skills.skill_card.hit.spread.target_nearest");
  }
  return c;
}
function le_Mc(a, b, c, d) {
  if (b && c && d)
    a = le_.t(
      `skills.skill_card.${a}.health_mana_ward`,
      { healthValue: b, manaValue: c, wardValue: d },
      "mod-value"
    );
  else if (b && c)
    a = le_.t(
      `skills.skill_card.${a}.health_mana`,
      { healthValue: b, manaValue: c },
      "mod-value"
    );
  else if (b && d)
    a = le_.t(
      `skills.skill_card.${a}.health_ward`,
      { healthValue: b, wardValue: d },
      "mod-value"
    );
  else if (c && d)
    a = le_.t(
      `skills.skill_card.${a}.mana_ward`,
      { manaValue: c, wardValue: d },
      "mod-value"
    );
  else if (b)
    a = le_.t(`skills.skill_card.${a}.health`, { healthValue: b }, "mod-value");
  else if (c)
    a = le_.t(`skills.skill_card.${a}.mana`, { manaValue: c }, "mod-value");
  else if (d)
    a = le_.t(`skills.skill_card.${a}.ward`, { wardValue: d }, "mod-value");
  else return null;
  return a;
}
function le_Pc(a) {
  switch (a) {
    case AT.DoT:
      return "Damage over Time";
    case AT.Throwing:
      return "Throwing Attack";
    case AT.Bow:
      return "Bow Attack";
    default:
      return $db.getTextForAT(a) || "";
  }
}
function le_Kb(a) {
  const b = [];
  $.each(a, function (c, d) {
    b.push(le_Pc(d));
  });
  return b;
}
function le_Gb(a) {
  le_Jb();
  var b = $db.getEnumerableTags(a.tags | a.fakeTags);
  const c = le_Kb(b);
  b = a.areaTagDisplay;
  (b != le_Lb.Tag && b != le_Lb.TagAndMinionTag) || c.push("Area");
  a.instantCastForPlayer && c.push("Instant Cast");
  b = !0;
  a.channelled || (b = a.stopMovementOnKeyRelease);
  b && c.push("Channeled");
  a.transform && c.push("Transform");
  b = !0;
  0 == a.movementDuringUse && (b = a.countsAsMovementAbility);
  (b || (a.transform && a.transformHasMovementSkill)) && c.push("Movement");
  (null != a.traversalSkill
    ? a.traversalSkill
    : null != a.sharedCooldown && a.sharedCooldown) && c.push("Traversal");
  a.companion && c.push("Companion");
  $.each(a.attributeScaling, function (d) {
    c.push(le_9a(d));
  });
  return c;
}
function le_Hb(a) {
  let b = "";
  $.each(a, function (c, d) {
    "" != b && (b += " ");
    b += '<span class="ability-tag">' + d + "</span>";
  });
  return b;
}
function le_zc(a) {
  const b = [];
  $.each(a, function (c, d) {
    const f = [];
    $.each(d, function (k, n) {
      k = $db.formatBuff(n, $db.Nb());
      f.push('<li class="attr-scaling-stat">' + k + "</li>");
    });
    0 < f.length &&
      (b.push(
        '<div class="attr-scaling">' +
          le_.t(`skills.skill_card.scaling_per_point_of.${le_$a(c)}`) +
          "</div>"
      ),
      b.push('<ul class="attr-scaling-stats">' + f.join("") + "</ul>"));
  });
  return b;
}
function le_Ac(a) {
  const b = [],
    c = [];
  $.each(a, function (d, f) {
    d = $db.formatBuff(f, $db.Nb());
    c.push('<div class="level-scaling-stat">' + d + "</div>");
  });
  0 < c.length &&
    (b.push(
      '<div class="attr-scaling">' +
        le_.t("skills.skill_card.scaling_per_char_level") +
        "</div>"
    ),
    b.push('<ul class="attr-scaling-stats">' + c.join("") + "</ul>"));
  return b;
}
function le_Cc(a) {
  const b = [],
    c = [];
  a.forEach(function (f) {
    f &&
      (b.push(
        `<span class="rune-icon-inline"><span class="icons icons-${LEAbilities.runeIcons[
          f
        ].substr(2)}"></span></span>`
      ),
      c.push(le_Qc[f]));
  });
  let d = (a = "");
  0 == b.length
    ? ((a = ""), (d = le_.t("skills.runic_invocations.no_runes")))
    : ((a = `${b.join("")}`), (d = `(${c.join(" ")})`));
  return `<span class="rune-icon-list">${a}</span><span class="rune-text-list">${d}</span>`;
}
class le_Rc extends le_lb {
  format(a, b) {
    const c = LEAbilities.abilityList[a];
    if (!c) return console.error("ability " + a + " not found"), "";
    const d = this;
    b = b || {};
    const f = b.td;
    var k = b.xg,
      n = b.sg,
      m = b.hf;
    le_Jb().Md(c);
    b = le_Nb(c, c.prefab.components, f);
    const p = [],
      r = [];
    $.each(b.Cd, function (E, O) {
      r.push([O]);
    });
    $.each(b.Fd, function (E, O) {
      r.push([O]);
    });
    r.push(b.Bd);
    r.push(b.Pd);
    r.push(b.Jd);
    r.push(b.he);
    let w = !0;
    $.each(r, function (E, O) {
      0 < O.length &&
        ((E = ""),
        w && ((w = !1), (E = " with-divider")),
        p.push(
          '<div class="ability-params' +
            E +
            '">' +
            O.join('<div class="separator"></div>') +
            "</div>"
        ));
    });
    const z = {};
    $.each(b.Ad, function (E, O) {
      var U = LEAbilities.abilityList[O.id];
      if (
        U &&
        le_v(O.id) &&
        !z[O.id] &&
        ((z[O.id] = !0), (E = le_xc(d, U, f, a)), 0 < E.length)
      ) {
        var L = "";
        (U = le_f(U)) && (L = U);
        null != O.Oa &&
          1 != O.Oa &&
          ((U = le_.t("skills.skill_card.cast_chance_value", {
            value: le_i(O.Oa),
          })),
          L ? (L = `${L} (${U})`) : (L = U));
        U = [];
        O.delay &&
          U.push(
            le_.t("skills.skill_card.cast_delay") + " " + le_k(le_l(O.delay))
          );
        O = "";
        L && (O = "<div>" + L + "</div>");
        L = "";
        0 < U.length &&
          (L = '<div class="ability-sub-extra">' + U.join("<br/>") + "</div>");
        p.push(
          '<div class="ability-params sub-ability"><div class="ability-name-sub">' +
            O +
            '</div><div class="ability-param-group">' +
            L +
            E.join("") +
            "</div></div>"
        );
      }
    });
    const I = [];
    $.each(b.Te, function (E, O) {
      (E = LEAbilities.abilityList[O.id]) &&
        le_v(O.id) &&
        ((E = le_w(E, c)),
        null != O.Oa &&
          1 != O.Oa &&
          ((O = le_.t("skills.skill_card.cast_chance_value", {
            value: le_i(O.Oa),
          })),
          (E = `${E} (${O})`)),
        I.push(E));
    });
    0 < I.length &&
      p.push(
        '<div class="ability-params with-divider"><div>' +
          le_.t("skills.skill_card.trigger_on_hit") +
          '</div><div class="ability-param-group">' +
          I.join('<div class="separator"></div>') +
          "</div></div>"
      );
    const N = [];
    $.each(b.Xe, function (E, O) {
      (E = LEAbilities.abilityList[O.id]) && le_v(O.id) && N.push(le_w(E, c));
    });
    0 < N.length &&
      p.push(
        '<div class="ability-params with-divider"><div>' +
          le_.t("skills.skill_card.trigger_on_ricochet") +
          '</div><div class="ability-param-group">' +
          N.join('<div class="separator"></div>') +
          "</div></div>"
      );
    const C = [];
    $.each(b.df, function (E, O) {
      (E = LEAbilities.abilityList[O.id]) && le_v(O.id) && C.push(le_w(E));
    });
    0 < C.length &&
      p.push(
        '<div class="ability-params with-divider"><div>' +
          le_.t("skills.skill_card.transform_skills") +
          '</div><div class="ability-param-group">' +
          C.join('<div class="separator"></div>') +
          "</div></div>"
      );
    const G = [];
    $.each(b.oe, function (E, O) {
      (E = LEAbilities.abilityList[O.id]) && le_v(O.id) && G.push(le_w(E, c));
    });
    0 < G.length &&
      p.push(
        '<div class="ability-params with-divider"><div>' +
          le_.t("skills.skill_card.combo_skills") +
          '</div><div class="ability-param-group">' +
          G.join('<div class="separator"></div>') +
          "</div></div>"
      );
    0 < b.Qc.length &&
      p.push(
        '<div class="ability-params with-divider"><div>' +
          le_.t("skills.skill_card.summon") +
          '</div><div class="ability-param-group">' +
          b.Qc.join('<div class="separator"></div>') +
          "</div></div>"
      );
    b = le_yc(c) || le_.t("skills.skill_card.scaling.none");
    p.push(
      '<div class="ability-params with-divider"><div>' +
        le_.t("skills.skill_card.scaling") +
        '</div><div class="ability-param-group">' +
        b +
        "</div></div>"
    );
    b = le_Fb(c) || le_.t("skills.skill_card.no_tags");
    p.push(
      '<div class="ability-params with-divider"><div>' +
        le_.t("skills.skill_card.scaling_tags") +
        '</div><div class="ability-tags">' +
        b +
        "</div></div>"
    );
    (b = le_Ib(c)) &&
      p.push(
        '<div class="ability-params"><div>' +
          le_.t("skills.skill_card.minion_tags") +
          '</div><div class="ability-tags">' +
          b +
          "</div></div>"
      );
    var H = le_Bc(c.id);
    b = "";
    H && (b = '<div class="bottom-block">' + H + "</div>");
    0 == p.length && console.log("no ability formatting", c.id, le_f(c));
    H = le_Db(c);
    const x = le_f(c),
      v = le_Mb(le_Ta(c));
    m = le_Dc(d, c, m);
    let D = "";
    k &&
      (D =
        '<div class="ability-params with-divider"><div class="ability-params-ranges">' +
        le_Ec(k) +
        "</div></div>");
    k = "";
    n &&
      (n = le_Fc(n)) &&
      (k =
        '<div class="ability-params with-divider"><div class="ability-params-mutator">' +
        n +
        "</div></div>");
    n = "";
    if (null != LEAbilities.invocations && LEAbilities.invocations[a]) {
      n = le_kb(c.internalName) + "/invocations";
      const E = le_.t("skills.skill_card.view_invocations_link");
      n =
        '<div class="view-invocations-block">' +
        `<a href="${le_c("/skills")}/${n}" internal_path="${n}">${E}</a>` +
        "</div>";
    }
    return (
      '<div class="ability-card"><div class="top-block"><div class="ability-bitmap-container"><div class="' +
      H +
      '"></div></div><div class="ability-description-block"><div class="ability-name" ability_id="' +
      c.id +
      '">' +
      x +
      '</div><div class="ability-description">' +
      v +
      "</div>" +
      n +
      '</div></div><div class="middle-block">' +
      D +
      k +
      '<div class="ability-params with-divider"><div>' +
      m +
      "</div></div>" +
      p.join("") +
      "</div>" +
      b +
      "</div>"
    );
  }
  jd(a) {
    return a == SP.CastSpeed
      ? le_.t("skills.skill_card.speed_scaling.cast", {}, "mod-value")
      : a == SP.AttackSpeed
      ? le_.t("skills.skill_card.speed_scaling.attack", {}, "mod-value")
      : a == SP.Movespeed
      ? le_.t("skills.skill_card.speed_scaling.movement", {}, "mod-value")
      : le_.t("skills.skill_card.speed_scaling.none");
  }
  g(a) {
    const b = [],
      c = le_jb(),
      d = a.find("div.ability-name").attr("ability_id");
    d && (c.Xc[d] = !0);
    le_q(this, a, c, !0, b, null);
    return b;
  }
}
const le_Qc = ["", "Rah", "Heo", "Gon"];
var le_eb = new le_Rc();
function le_Oc(a) {
  return $.grep(a, function (b, c) {
    return c === $.inArray(b, a);
  });
}
function le_v(a) {
  return "na28" != a;
}
function le_Gc(a) {
  a = a.actor.data;
  let b;
  a && (b = null != a.nameKey ? le_b(a.nameKey) : a.name);
  return b || "[Minion]";
}
class le_Sc {
  constructor() {
    this.id = "";
    this.I = {};
    this.C = {};
    this.g();
  }
  m() {
    throw Error("method not implemented");
  }
  j() {
    throw Error("method not implemented");
  }
  g() {
    throw Error("method not implemented");
  }
  i() {
    throw Error("method not implemented");
  }
  o() {
    throw Error("method not implemented");
  }
  l() {
    throw Error("method not implemented");
  }
  Md(a) {
    const b = this;
    a = a.id;
    b.g();
    const c = $.extend(!0, {}, b.C),
      d = b.B,
      f = b.m();
    if (f) {
      var k = b.j();
      k = null != k ? k.selected : {};
      var n = b.l();
      $.each(n, function (p) {
        d[p] = 1;
      });
      var m = LESkillTrees[a].nodes;
      $.each(k, function (p, r) {
        if (0 < r) {
          const w = f.mods[p];
          null != w &&
            $.each(w, function (z, I) {
              I *= b.o() ? 1 : r;
              d[z] = n[z] ? d[z] * (1 + I) : d[z] + I;
              null == c[z] && (c[z] = []);
              I = m[p];
              if (null != I) {
                z = c[z];
                var N = z.push;
                I = null != I.nodeNameKey ? le_b(I.nodeNameKey) : I.nodeName;
                N.call(z, { from: I, node: !0 });
              }
            });
        }
      });
      $.each(n, function (p) {
        --d[p];
      });
    } else console.error("no bonuses for skill tree", a);
  }
  jd(a) {
    return a.speedScaler || SP.None;
  }
}
class le_Tc extends le_Sc {
  m() {
    return {};
  }
  j() {
    return null;
  }
  g() {
    this.B = $.extend(!0, this.i(), this.I);
  }
  i() {
    return $.extend(
      !0,
      {},
      { procs: [], conversions: {}, acConversions: {}, skillBuffs: [] }
    );
  }
  o() {
    return !1;
  }
  l() {
    return {};
  }
  Md() {}
}
function le_Jb() {
  var a = le_Uc;
  null == a.g && (a.g = new le_Tc());
  return a.g;
}
class le_Vc {}
const le_Uc = new le_Vc();
skillBonuses = {};
function le_Wc(a, b, c) {
  let d = !1,
    f = "mouseenter focus";
  window.useMobileTippy && ((f = "click"), (d = !0));
  let k = window.useMobileTippy ? !1 : !0;
  tippy(b[0], {
    placement: "right",
    content: c[0],
    interactive: !1,
    arrow: !1,
    allowHTML: !0,
    hideOnClick: d,
    appendTo: a.i[0],
    delay: [100, 0],
    trigger: f,
    onShow: function (n) {
      n.props.content.style.maxHeight = document.body.clientHeight + "px";
      a.g = n;
      window.useMobileTippy && $(document.body).addClass("tippy-shown");
    },
    onShown: function () {
      k = !0;
    },
    onHide: function () {
      a.g = null;
      return k;
    },
    onHidden: function () {
      window.useMobileTippy &&
        !le_Xa() &&
        $(document.body).removeClass("tippy-shown");
    },
  });
}
class le_Xc {
  constructor() {
    var a = $(document.body);
    const b = this;
    b.i = a;
    b.g = null;
    $(document).on("keydown keyup", function () {
      if (b.g) {
        const c = le_Yc;
        b.g.props.interactive != c && b.g.setProps({ interactive: c });
      }
    });
  }
}
let le_Yc = !1;
$(document).on("keydown", function (a) {
  90 == a.keyCode && (le_Yc = !0);
});
$(document).on("keyup", function (a) {
  90 == a.keyCode && (le_Yc = !1);
});
const le_Zc = {
    DodgeChance: 10001,
    ArmorMitigation: 10002,
    BlockMitigation: 10003,
    MinionPowerFromCharacterLevel: 10004,
    IncreasedCompanionReviveRange: 10005,
    IncreasedCompanionReviveSpeed: 10006,
    TotalResistance: 10007,
    DoubleDamageChance: 10008,
  },
  le__c = {},
  le_0c = [
    "NotProtection",
    "ElementalProtection",
    "ArmourOrNonElementalProtection",
    "CombinedProtection",
  ];
for (let a = 0; a < le_0c.length; a++) le__c[le_0c[a]] = a;
const le_1c = {},
  le_2c = "None Hit Crit Kill Freeze Stun Block MeleeHit".split(" ");
for (let a = 0; a < le_2c.length; a++) le_1c[le_2c[a]] = a;
const le_Lb = {},
  le_3c = ["None", "Tag", "MinionTagOnly", "TagAndMinionTag"];
for (let a = 0; a < le_3c.length; a++) le_Lb[le_3c[a]] = a;
if (null == window.AT) {
  const a = {},
    b =
      "Damage AilmentChance AttackSpeed CastSpeed CriticalChance CriticalMultiplier DamageTaken Health Mana Movespeed Armour DodgeRating StunAvoidance FireResistance ColdResistance LightningResistance WardRetention HealthRegen ManaRegen Strength Vitality Intelligence Dexterity Attunement ManaBeforeHealthPercent ChannelCost VoidResistance NecroticResistance PoisonResistance BlockChance AllResistances DamageTakenAsPhysical DamageTakenAsFire DamageTakenAsCold DamageTakenAsLightning DamageTakenAsNecrotic DamageTakenAsVoid DamageTakenAsPoison HealthGain WardGain ManaGain AdaptiveSpellDamage IncreasedAilmentDuration IncreasedAilmentEffect IncreasedHealing IncreasedStunChance AllAttributes IncreasedPotionDropRate PotionHealth PotionSlots HasteOnHitChance HealthLeech ElementalResistance BlockEffectiveness None IncreasedStunImmunityDuration StunImmunity ManaDrain AbilityProperty Penetration CurrentHealthDrain MaximumCompanions GlancingBlowChance CullPercentFromPassives PhysicalResistance CullPercentFromWeapon ManaCost FreezeRateMultiplier IncreasedChanceToBeFrozen ManaEfficiency IncreasedCooldownRecoverySpeed ReceivedStunDuration NegativePhysicalResistance ChillRetaliationChance SlowRetaliationChance Endurance EnduranceThreshold NegativeArmour NegativeFireResistance NegativeColdResistance NegativeLightningResistance NegativeVoidResistance NegativeNecroticResistance NegativePoisonResistance NegativeElementalResistance Thorns PercentReflect ShockRetaliationChance LevelOfSkills CritAvoidance PotionHealthConvertedToWard WardOnPotionUse WardRegen OverkillLeech ManaBeforeWardPercent IncreasedStunDuration MaximumHealthGainedAsEnduranceThreshold ChanceToGain30WardWhenHit PlayerProperty ManaSpentGainedAsWard AilmentConversion PerceivedUnimportanceModifier IncreasedLeechRate MoreFreezeRatePerStackOfChill IncreasedDropRate IncreasedExperience PhysicalAndVoidResistance NecroticAndPoisonResistance DamageTakenBuff IncreasedChanceToBeStunned DamageTakenFromNearbyEnemies BlockChanceAgainstDistantEnemies ChanceToBeCrit DamageTakenWhileMoving LessBonusDamageTakenFromCrits DamagePerStackOfAilment IncreasedAreaForAreaSkills GlobalConditionalDamage".split(
        " "
      );
  for (let f = 0; f < b.length; f++) a[b[f]] = f;
  const c = {},
    d =
      "None Ignite Bleed Chill Possess Shock Slow Poison ArmourShred TimeRot FutureAttack Laceration AbyssalDecay StackingAbyssalDecay Blind SerpentVenom Frailty MarkedForDeath Plague Ravage Root Fear DamageBoost Frostbite SpreadingFlames FireballStackForExplosion VoidEssence HolyAuraStackForFlamBurst PoisonResShred NecroticResShred VoidResShred Stagger DivineEssence Haste Frenzy Swiftness PoisonStackForExplosion AvalancheStackForFissure TempestsMight Damned Pestilence DisintegrateStackForExplosion FireResShred MeleeDefShred Stalwart Inspiration DummyHealingWhileNotTakingDamage Deadly AspectOfTheBoarVisuals AspectOfTheSharkVisuals StackingAspectOfTheSharkVisuals AspectOfTheViperVisuals AspectOfTheLynxVisuals ArcaneMark Immobilized SparkCharge CriticalEffluence ArcaneAscendance BoneCurse SpiritPlague ShrineHaste Contempt ShrineReflect ShrineStun ShrineCrit ShrineManatee Shapeshifter Ferocity DoomBrand NecroticBoneCurse Apocalypse Flurry1Tag Flurry2Tag PhysicalResShred ColdResShred LightningResShred Enrage LightningInfusion EfficaciousToxin ShadowDaggers MirageForm SilverShroud DuskShroud CrimsonShroud SmokeBlades CriticalVulnerability Sharpshooter ShrineExperienceBuff AspectOfTheCrow AncientFlight Doom MoltenInfusion StoneStare Electrify TotemArmor SciurineRage Darkness CorruptedHeraldry MimicFeast VoidBarrierVisuals Immunity SnakeInfection".split(
        " "
      );
  for (let f = 0; f < d.length; f++) c[d[f]] = f;
  window.AT = {
    None: 0,
    Physical: 1,
    Lightning: 2,
    Cold: 4,
    Fire: 8,
    Void: 16,
    Necrotic: 32,
    Poison: 64,
    Elemental: 128,
    Spell: 256,
    Melee: 512,
    Throwing: 1024,
    Bow: 2048,
    DoT: 4096,
    Minion: 8192,
    Totem: 16384,
    PetResisted: 32768,
    Potion: 65536,
    Buff: 131072,
    Channelling: 262144,
    Transform: 524288,
    LowLife: 1048576,
    HighLife: 2097152,
    FullLife: 4194304,
    Hit: 8388608,
    Curse: 16777216,
    Dodge_deprecated: 33554432,
    Crit_deprecated: 67108864,
    Kill_deprecated: 134217728,
    Die_deprecated: 268435456,
  };
  window.SP = a;
  window.AilmentID = c;
}
const le_4c = [
    SP.DamageTaken,
    SP.HealthGain,
    SP.ManaGain,
    SP.WardGain,
    SP.HealthLeech,
    SP.DamageTakenAsCold,
    SP.DamageTakenAsFire,
    SP.DamageTakenAsLightning,
    SP.DamageTakenAsNecrotic,
    SP.DamageTakenAsPhysical,
    SP.DamageTakenAsPoison,
    SP.DamageTakenAsVoid,
  ],
  le_5c = [
    SP.DamageTakenAsCold,
    SP.DamageTakenAsFire,
    SP.DamageTakenAsLightning,
    SP.DamageTakenAsNecrotic,
    SP.DamageTakenAsPhysical,
    SP.DamageTakenAsPoison,
    SP.DamageTakenAsVoid,
  ];
window.ProtectionType = le__c;
window.HitEventTag = le_1c;
window.hitEventTaggableProperties = le_4c;
window.damageTakenAsProperties = le_5c;
window.uniqueMinLP = { 238: 1, 239: 1, 240: 1, 241: 1 };
window.LPChances = [
  [0.39679998, 0.196992, 0.04251136, 0.0036966398],
  [0.3964387, 0.19262609, 0.04063693, 0.003352422],
  [0.39597014, 0.18829602, 0.03882209, 0.0030377493],
  [0.39539582, 0.1840033, 0.037066303, 0.0027503062],
  [0.39471716, 0.17974934, 0.0353689, 0.0024879375],
  [0.39393562, 0.17553565, 0.03372917, 0.0022486455],
  [0.39305258, 0.17136346, 0.03214627, 0.0020305743],
  [0.39206955, 0.16723408, 0.030619338, 0.0018320038],
  [0.39098793, 0.16314873, 0.029147431, 0.0016513406],
  [0.38980916, 0.15910855, 0.027729547, 0.001487108],
  [0.38853472, 0.15511462, 0.026364656, 0.0013379405],
  [0.38716593, 0.15116797, 0.02505165, 0.0012025734],
  [0.3857044, 0.1472696, 0.023789434, 0.0010798406],
  [0.3841514, 0.14342041, 0.02257684, 9.6866285e-4],
  [0.38250843, 0.13962129, 0.02141271, 8.680459e-4],
  [0.38077694, 0.13587299, 0.02029584, 7.7707187e-4],
  [0.37895828, 0.1321763, 0.019225018, 6.9489557e-4],
  [0.37705398, 0.12853193, 0.018199028, 6.2073884e-4],
  [0.3750654, 0.12494053, 0.017216645, 5.538857e-4],
  [0.3729939, 0.12140269, 0.016276633, 4.936781e-4],
  [0.37084097, 0.11791897, 0.015377756, 4.3951147e-4],
  [0.36860806, 0.11448985, 0.01451878, 3.9083115e-4],
  [0.36629653, 0.11111584, 0.013698485, 3.4712887e-4],
  [0.36390787, 0.1077973, 0.012915646, 3.079385e-4],
  [0.36144346, 0.10453463, 0.012169055, 2.7283383e-4],
  [0.3589047, 0.10132814, 0.0114575075, 2.4142482e-4],
  [0.35629296, 0.09817812, 0.010779821, 2.1335534e-4],
  [0.35360977, 0.09508477, 0.010134824, 1.883003e-4],
  [0.35085642, 0.09204832, 0.0095213605, 1.6596327e-4],
  [0.3480344, 0.08906892, 0.008938297, 1.4607426e-4],
  [0.3451451, 0.08614666, 0.008384509, 1.2838747e-4],
  [0.34218997, 0.08328165, 0.007858905, 1.1267965e-4],
  [0.3391703, 0.08047391, 0.0073604053, 9.874787e-5],
  [0.33608767, 0.07772346, 0.0068879565, 8.6408225e-5],
  [0.3329433, 0.07503022, 0.006440524, 7.549393e-5],
  [0.32973874, 0.07239418, 0.006017102, 6.585416e-5],
  [0.32647535, 0.069815196, 0.0056167035, 5.735249e-5],
  [0.3231545, 0.06729314, 0.0052383672, 4.986574e-5],
  [0.31977767, 0.06482786, 0.004881158, 4.3282864e-5],
  [0.31634623, 0.062419128, 0.004544161, 3.750379e-5],
  [0.31286156, 0.06006673, 0.0042264923, 3.2438536e-5],
  [0.3093251, 0.057770394, 0.0039272876, 2.8006229e-5],
  [0.30573824, 0.055529837, 0.0036457109, 2.4134326e-5],
  [0.3021024, 0.05334474, 0.0033809494, 2.0757827e-5],
  [0.29841894, 0.05121475, 0.0031322164, 1.7818575e-5],
  [0.29468933, 0.049139492, 0.0028987494, 1.526461e-5],
  [0.29091492, 0.04711858, 0.0026798113, 1.3049584e-5],
  [0.28709722, 0.045151576, 0.002474689, 1.1132205e-5],
  [0.28323752, 0.043238044, 0.0022826926, 9.475753e-6],
  [0.2793373, 0.0413775, 0.002103158, 8.047625e-6],
  [0.27539793, 0.03956945, 0.0019354434, 6.8189147e-6],
  [0.27142087, 0.03781338, 0.0017789314, 5.7640477e-6],
  [0.26740748, 0.03610875, 0.001633026, 4.860425e-6],
  [0.2633592, 0.03445501, 0.0014971556, 4.088122e-6],
  [0.25927746, 0.032851566, 0.0013707698, 3.429599e-6],
  [0.2551637, 0.03129783, 0.0012533397, 2.8694467e-6],
  [0.2510193, 0.029793184, 0.0011443583, 2.3941552e-6],
  [0.24684569, 0.028336989, 0.0010433393, 1.9919014e-6],
  [0.24264428, 0.026928596, 9.4981637e-4, 1.6523614e-6],
  [0.23841657, 0.025567345, 8.633443e-4, 1.366541e-6],
  [0.23416394, 0.024252543, 7.834959e-4, 1.1266181e-6],
  [0.22988783, 0.022983499, 7.098641e-4, 9.2580956e-7],
  [0.22558972, 0.021759499, 6.420598e-4, 7.582443e-7],
  [0.22127102, 0.020579811, 5.7971186e-4, 6.188544e-7],
  [0.21693319, 0.019443708, 5.224671e-4, 5.0327617e-7],
  [0.2125777, 0.018350432, 4.6998874e-4, 4.0776172e-7],
  [0.208206, 0.01729922, 4.2195697e-4, 3.2910108e-7],
  [0.20381956, 0.016289301, 3.780679e-4, 2.645528e-7],
  [0.19941984, 0.015319889, 3.38033e-4, 2.117821e-7],
  [0.19500838, 0.014390195, 3.0157896e-4, 1.6880676e-7],
  [0.19058666, 0.013499415, 2.6844692e-4, 1.3394911e-7],
  [0.18615611, 0.012646733, 2.38392e-4, 1.0579384e-7],
  [0.18171833, 0.011831337, 2.11183e-4, 8.3151065e-8],
  [0.17727476, 0.011052394, 1.8660168e-4, 6.5023926e-8],
  [0.172827, 0.010309079, 1.6444245e-4, 5.058033e-8],
  [0.16837656, 0.009600545, 1.4451184e-4, 3.9128423e-8],
  [0.163925, 0.008925953, 1.2662806e-4, 3.009521e-8],
  [0.1594739, 0.0082844505, 1.10620495e-4, 2.300815e-8],
  [0.15502483, 0.0076751867, 9.632931e-5, 1.7479213e-8],
  [0.15057941, 0.0070973025, 8.360495e-5, 1.3191241e-8],
  [0.14613922, 0.0065499363, 7.230773e-5, 9.886233e-9],
  [0.14170595, 0.0060322257, 6.230746e-5, 7.3553745e-9],
  [0.13728124, 0.0055433055, 5.3482894e-5, 5.4305347e-9],
  [0.13286676, 0.005082306, 4.5721426e-5, 3.9770978e-9],
  [0.12846424, 0.0046483628, 3.8918664e-5, 2.8879084e-9],
  [0.124075375, 0.004240604, 3.297799e-5, 2.0781885e-9],
  [0.119701974, 0.0038581626, 2.7810212e-5, 1.481303e-9],
  [0.11534581, 0.0035001698, 2.333318e-5, 1.0452327e-9],
  [0.11100873, 0.0031657591, 1.9471392e-5, 7.2966233e-10],
  [0.10669261, 0.0028540653, 1.6155656e-5, 5.035873e-10],
  [0.10239935, 0.002564225, 1.3322729e-5, 3.433574e-10],
  [0.09813091, 0.002295378, 1.0914967e-5, 2.3108873e-10],
  [0.0938893, 0.0020466668, 8.880003e-6, 1.5338256e-10],
  [0.08967662, 0.0018172385, 7.170414e-6, 1.00299526e-10],
  [0.08549497, 0.0016062439, 5.7434104e-6, 6.454445e-11],
  [0.08134659, 0.001412839, 4.5605243e-6, 4.0823428e-11],
  [0.07723374, 0.001236185, 3.587323e-6, 2.53418e-11],
  [0.073158816, 0.0010754492, 2.7931142e-6, 1.5415275e-11],
  [0.06912428, 9.2980545e-4, 2.1506758e-6, 9.172064e-12],
  [0.06513274, 7.984347e-4, 1.6359858e-6, 5.3271094e-12],
  [0.061186906, 6.805256e-4, 1.2279669e-6, 3.0130093e-12],
  [0.057289664, 5.7527533e-4, 9.0824255e-7, 1.6550543e-12],
  [0.05344404, 4.8188973e-4, 6.608961e-7, 8.8014253e-13],
  [0.049653277, 3.995844e-4, 4.7224853e-7, 4.5145403e-13],
  [0.045920845, 3.2758535e-4, 3.3064094e-7, 2.2237788e-13],
  [0.04225047, 2.6512943e-4, 2.2622874e-7, 1.046444e-13],
  [0.038646217, 2.1146546e-4, 1.5078709e-7, 4.6746125e-14],
  [0.03511252, 1.6585476e-4, 9.75255e-8, 1.9671092e-14],
  [0.031654276, 1.2757226e-4, 6.0914e-8, 7.723375e-15],
  [0.028276954, 9.5907315e-5, 3.6519122e-8, 2.7953531e-15],
  [0.02498673, 7.016492e-5, 2.0851218e-8, 9.182696e-16],
  [0.021790683, 4.966682e-5, 1.1222183e-8, 2.6823945e-16],
  [0.018697068, 3.3752967e-5, 5.6143628e-9, 6.7773694e-17],
  [0.015715705, 2.1783097e-5, 2.5604008e-9, 1.4246734e-17],
  [0.012858587, 1.3138657e-5, 1.034334e-9, 2.3538392e-18],
  [0.01014087, 7.2251923e-6, 3.5405856e-10, 2.7985937e-19],
  [0.0075825425, 3.4753132e-6, 9.533321e-11, 2.0655272e-20],
  [0.0052117193, 1.352699e-6, 1.7563232e-11, 7.173754e-22],
  [0.0030719924, 3.5778777e-7, 1.6187799e-12, 6.2950694e-24],
  [0.0012442705, 3.683399e-8, 2.748726e-14, 1.918537e-27],
  [0, 0, 0, 0],
];
let le_r = {},
  le_s = {},
  le_6c = {},
  le_t = {},
  le_u = {},
  le_hb = {},
  le_7c = {},
  le_8c = {},
  le_A = {};
(function (a, b) {
  function c(e, g) {
    if (!e) return "";
    g = g || {};
    let h = "";
    g.addAlpha && (h += " with-alpha");
    let l = "";
    g.addReqNotMetOverlay && (l += '<div class="req-not-met-overlay"></div>');
    return (
      l +
      '<div class="item-bitmap itemdb ' +
      gb(e.sprite + ".png") +
      h +
      '"></div>'
    );
  }
  function d(e) {
    let g = [];
    var h = T(e);
    g.push("<div>" + oa(e, null, null, h) + "</div>");
    (h = e.itemText) &&
      g.push('<div class="item-description-text">' + h + "</div>");
    le_t[e.id] || le_u[e.id]
      ? g.push(Cb(f(e)))
      : g.push('<div class="item-type">' + Db(e) + "</div>");
    if (100 > e.baseTypeId) {
      h = D(e);
      const l = [];
      b.each(h, function (q, t) {
        t && l.push('<div class="item-implicit">' + t + "</div>");
      });
      0 < l.length && (g = g.concat(l));
    }
    return (
      '<div class="item-bitmap-container">' +
      c(e) +
      '</div><div class="item-description">' +
      g.join("") +
      "</div>"
    );
  }
  function f(e) {
    const g = le_Ea(e);
    if (g) return g;
    if (null != e.specialAffixType && 1 == e.specialAffixType)
      return "Experimental";
  }
  function k(e, g, h) {
    let l = [];
    var q = [];
    const t = T(e);
    var u = !1;
    100 > e.baseTypeId
      ? ((q = E(e)), (u = !0))
      : 101 == e.baseTypeId
      ? (q.push(v(le_za(e))),
        (g = le_A[e.subTypeId])
          ? (q.push(hb(g.canRollOn)),
            q.push(
              '<div class="shard-affix">' +
                (le_t[g.id]
                  ? le_.t("item_db.shard_card.prefix")
                  : le_.t("item_db.shard_card.suffix")) +
                " " +
                oa(g, null, null, T(g)) +
                "</div>"
            ))
          : console.error("no affix for shard", e.subTypeId))
      : le_t[e.id] || le_u[e.id]
      ? (l.push(Eb(e, e.tiers, g)), q.push(hb(e.canRollOn)))
      : q.push(v(le_za(e)));
    if (u) {
      const K = [];
      b.each(q, function (M, P) {
        P && K.push('<div class="item-mod-unique">' + P + "</div>");
      });
      0 < K.length &&
        (l.push(
          '<div class="implicits-title">' +
            le_.t("item_db.item_card.implicits") +
            "</div>"
        ),
        (l = l.concat(K)));
    } else {
      const K = [];
      b.each(q, function (M, P) {
        P && K.push("<div>" + P + "</div>");
      });
      0 < K.length && (l = l.concat(K));
    }
    "idol" == Qa[e.baseTypeId] &&
      ((q = aa[e.baseTypeId]),
      (q =
        le_.t("item_db.item_card.idol_size") +
        " " +
        q.size.x +
        "&times;" +
        q.size.y),
      l.push("<div>" + q + "</div>"));
    q = F(e);
    const y = [],
      B = [];
    b.each(q, function (K, M) {
      if (M) {
        K = M.Pa;
        let P = !1,
          W = "";
        "prefix" == M.Ib
          ? (W = " prefix")
          : "suffix" == M.Ib
          ? (W = " suffix")
          : "sealed" == M.Ib && ((W = " sealed"), (P = !0));
        9 == t
          ? (W += " rarity9")
          : M.De
          ? (W += " rarity12")
          : M.ze
          ? (W += " rarity11")
          : 5 < M.ee && (W += " rarity10");
        const ea = "T" + M.ee;
        "prefix" == M.Ib || "suffix" == M.Ib
          ? (K += ' <div class="tier centered">' + ea + "</div>")
          : "sealed" == M.Ib &&
            (K +=
              ' <div class="tier centered"><svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" title="Sealed"><path d="M9 14H6q-1.667 0-2.833-1.167Q2 11.667 2 10q0-1.667 1.167-2.833Q4.333 6 6 6h3v1.5H6q-1.042 0-1.771.729Q3.5 8.958 3.5 10q0 1.042.729 1.771.729.729 1.771.729h3Zm-2-3.25v-1.5h6v1.5ZM11 14v-1.5h3q1.042 0 1.771-.729.729-.729.729-1.771 0-1.042-.729-1.771Q15.042 7.5 14 7.5h-3V6h3q1.667 0 2.833 1.167Q18 8.333 18 10q0 1.667-1.167 2.833Q15.667 14 14 14Z"></path></svg> ' +
              ea +
              "</div>");
        P
          ? B.push(`<div class="item-mod-unique${W}">${K}</div>`)
          : y.push(`<div class="item-mod-unique${W}">${K}</div>`);
      }
    });
    const J = [];
    null != e.uniqueId &&
      ((q = e.subTypeIds ? Z(e) : R(e)),
      b.each(q, function (K, M) {
        M && J.push('<div class="item-mod-unique">' + M + "</div>");
      }));
    q = y.concat(J, B);
    0 < q.length &&
      (l.push(
        '<div class="modifiers-title">' +
          le_.t("item_db.item_card.modifiers") +
          "</div>"
      ),
      (l = l.concat(q)));
    if ((q = e.rSetId && le_hb[e.rSetId]))
      (u = []),
        u.push('<div class="tooltip-skill-params item-set-ref">'),
        u.push(
          '<div><a class="item-set-name rarity8" item-set-id="' +
            q.id +
            '">' +
            q.displayName +
            "</a></div>"
        ),
        (u = u.concat(Fb(q, h ? null : e.id, h))),
        u.push("</div>"),
        l.push(u.join(""));
    const Q = [e.id];
    b.each(e.compositeMods, function (K, M) {
      Q.push(M.affixId);
    });
    q && Q.push(q.id);
    h = n(Q);
    0 < h.length && (l = l.concat(h));
    (h = le_Ca(e)) &&
      l.push(
        '<div class="item-padded-v item-lore rarity' + t + '">' + h + "</div>"
      );
    h = ib(e);
    0 < h.length && (l = l.concat(h));
    (h = pa[e.baseTypeId + "-" + e.subTypeId]) &&
      h.minimumDropLevel &&
      ((h = "<span style='color:#FFF'>" + h.minimumDropLevel + "</span>"),
      l.push(
        '<div class="item-req2">' +
          (le_.t("item_db.item_card.drop_info.minimum_drop_level") + " " + h) +
          "</div>"
      ));
    34 == e.baseTypeId &&
      (e = qc(e)) &&
      l.push(
        '<div class="item-padded-v" style="color:#e3ba6b">' + e + "</div>"
      );
    return l.join("");
  }
  function n(e) {
    const g = [];
    if (itemDB.relModAbilities) {
      let h = [];
      b.each(e, function (q, t) {
        (q = itemDB.relModAbilities[t]) && (h = h.concat(q));
        (t = itemDB.relIncLevelAbilities[t]) && (h = h.concat(t));
      });
      if (0 < h.length) {
        const q = m(h);
        q && g.push(q);
      }
      let l = [];
      b.each(e, function (q, t) {
        (q = itemDB.relModAilments[t]) && (l = l.concat(q));
      });
      0 < l.length && (e = p(l)) && g.push(e);
    } else
      (e = itemDB.relatedAbilities[e[0]]) &&
        b.each(e, function (h, l) {
          a: {
            if (null != LEAbilities.abilityList[l]) {
              if ((h = LEAbilities.abilityList[l])) {
                l = [];
                var q = le_Eb(h);
                0 < q.length &&
                  l.push(
                    '<div class="ability-params with-divider"><div>' +
                      q.join("<br/>") +
                      "</div></div>"
                  );
                q = le_Fb(h) || le_.t("skills.skill_card.no_tags");
                l.push(
                  '<div class="ability-params with-divider"><div>' +
                    le_.t("skills.skill_card.scaling_tags") +
                    '</div><div class="ability-tags">' +
                    q +
                    "</div></div>"
                );
                (q = le_Ib(h)) &&
                  l.push(
                    '<div class="ability-params" style="padding-top:4px"><div>' +
                      le_.t("skills.skill_card.minion_tags") +
                      '</div><div class="ability-tags">' +
                      q +
                      "</div></div>"
                  );
                0 == l.length &&
                  console.log("no ability formatting", h.id, le_f(h));
                q = le_w(h);
                h = le_Mb(le_Ta(h));
                l =
                  '<div class="ability-card"><div class="ability-description-block condensed">' +
                  q +
                  '<div class="ability-description">' +
                  h +
                  "</div>" +
                  l.join("") +
                  "</div></div>";
              } else console.error("ability " + l + " not found"), (l = "");
              if (l) {
                l = '<div class="related-ability">' + l + "</div>";
                break a;
              }
            }
            l = null;
          }
          l && g.push(l);
        });
    return g;
  }
  function m(e) {
    const g = [],
      h = {};
    b.each(e, function (l, q) {
      h[q] ||
        ((h[q] = !0), (l = LEAbilities.abilityList[q]) && g.push(le_w(l)));
    });
    return 0 < g.length
      ? '<div class="related-refs"><div class="refs-title">' +
          le_.t("item_db.item_card.related_abilities") +
          '</div><div class="refs-group">' +
          g.join('<div class="refs-separator"></div>') +
          "</div></div>"
      : null;
  }
  function p(e) {
    const g = [],
      h = {};
    b.each(e, function (l, q) {
      h[q] || ((h[q] = !0), (l = la(q)) && g.push(le_x(l)));
    });
    return 0 < g.length
      ? '<div class="related-refs"><div class="refs-title">' +
          le_.t("item_db.item_card.related_ailments") +
          '</div><div class="refs-group">' +
          g.join('<div class="refs-separator"></div>') +
          "</div></div>"
      : null;
  }
  function r(e, g, h) {
    if (null == e.uniqueId || 1 == e.legendaryType || Gb(e)) return null;
    g = null != g ? g : e.effectiveLevelForLegendaryPotential;
    (null != h ? h : e.overrideEffectiveLevelForLegendaryPotential) ||
      (g = ua(e, null, !0));
    return null != e.rSetId || 120 <= g ? null : g;
  }
  function w(e, g, h) {
    if (null == e.uniqueId) return { ok: !1, Pa: "" };
    if (1 == e.legendaryType)
      return {
        ok: !1,
        Pa:
          '<div class="title"><span class="rarity-tier-text">' +
          le_
            .t("item_db.item_card.weavers_will_cant_have_lp")
            .replace(
              /<a1>([^<]+)<\/a1>/i,
              `<a href="${le_c("/guide")}/section/weavers_will">$1</a>`
            )
            .replace(
              /<a2>([^<]+)<\/a2>/i,
              `<a href="${le_c("/guide")}/section/legendary_items">$1</a>`
            ) +
          "</span></div>",
      };
    g = r(e, g, h);
    if (null == g)
      return (
        le_
          .t("item_db.item_card.cant_have_lp")
          .replace(
            /<a1>([^<]+)<\/a1>/i,
            `<a href="${le_c("/guide")}/section/legendary_items">$1</a>`
          ),
        {
          ok: !1,
          Pa:
            '<div class="title"><span class="rarity-tier-text">' +
            le_.t("item_db.item_card.cant_have_lp") +
            "</span></div>",
        }
      );
    h = "";
    const l = LPChances[g];
    if (l) {
      const q = [],
        t = uniqueMinLP[e.uniqueId] || 0;
      b.each(l, function (u, y) {
        u += 1;
        var B = 100 * (t >= u ? 1 : y);
        y =
          1 <= B
            ? Math.tc(B, -2)
            : Math.tc(
                parseFloat(
                  B.toFixed(1 - Math.floor(Math.log(B) / Math.log(10)))
                ),
                -5
              );
        0 == y && (y = B);
        B = y;
        if (
          (B =
            100 == B
              ? le_.t("item_db.item_card.lp_rarity.guaranteed")
              : 25 < B
              ? le_.t("item_db.item_card.lp_rarity.common")
              : 5 < B
              ? le_.t("item_db.item_card.lp_rarity.uncommon")
              : 1 < B
              ? le_.t("item_db.item_card.lp_rarity.rare")
              : 0.1 < B
              ? le_.t("item_db.item_card.lp_rarity.very_rare")
              : 0.01 < B
              ? le_.t("item_db.item_card.lp_rarity.extremely_rare")
              : 0.001 < B
              ? le_.t("item_db.item_card.lp_rarity.unbelievably_rare")
              : le_.t("item_db.item_card.lp_rarity.almost_impossible"))
        )
          (y = le_.t("item_db.item_card.lp_roll_chance") + ` ${y}%`),
            (u = le_.t("item_db.item_card.lp_index", { index: u })),
            q.push(
              "<li>" +
                `${u} - <span class="rarity-value with-hover-text">${B}${`<span class="hover-text hover-text-nowrap">${y}</span>`}</span>` +
                "</li>"
            );
      });
      h = `<ul>${q.join("")}</ul>`;
    }
    return {
      ok: !0,
      Pa:
        '<div class="title with-hover-text">' +
        `<span class="rarity-tier-text">${le_
          .t("item_db.item_card.effective_level_for_lp")
          .replace(
            /<a1>([^<]+)<\/a1>/i,
            `<a href="${le_c("/guide")}/section/legendary_items">$1</a>`
          )}</span> ${g}` +
        "</div>" +
        h,
    };
  }
  function z(e) {
    return null == e.uniqueId ||
      N(e) ||
      (!e.notTimelineExclusive && C(e)) ||
      G(e)
      ? !1
      : !0;
  }
  function I(e) {
    if (z(e)) {
      e = ba(e);
      var g = jb.i[e];
      if (null != g)
        return (
          (g =
            '<a class="timeline" timeline-id="' +
            g +
            '">' +
            le_Oa(timelineData[g]) +
            "</a>"),
          (e = jb.g[e]),
          '<div class="title"><span class="rarity-tier-text">' +
            le_.t("item_db.item_card.drop_info.timeline_to_farm") +
            "</span> " +
            g +
            '<span class="text-white"> (' +
            le_.t("item_db.item_card.drop_info.timeline_echo_rewards", {
              name: e,
            }) +
            ")</span></div>"
        );
    }
  }
  function N(e) {
    return !(
      null == e.uniqueId ||
      !e.subTypeIds ||
      !itemDB.fracturedUniques[e.uniqueId]
    );
  }
  function C(e) {
    return !(null == e.uniqueId || !itemDB.monsterDrops[e.uniqueId]);
  }
  function G(e) {
    return !(null == e.uniqueId || !itemDB.questRewards[e.uniqueId]);
  }
  function H(e) {
    return e
      ? le_.t("item_db.item_card.drop_info.cant_drop")
      : le_.t("item_db.item_card.drop_info.can_drop");
  }
  function x(e) {
    let g;
    b.isPlainObject(e)
      ? (g =
          '<span class="old-value">' +
          H(e.oldValue) +
          '</span><span class="new-value">' +
          H(e.value) +
          "</span>")
      : e && (g = H(e));
    if (g) return '<div class="rarity-tier-text">' + g + "</div>";
  }
  function v(e) {
    const g = [];
    b.each((e || "").split(/\\n|\n/), function (h, l) {
      g.push('<div class="item-description-part">' + l + "</div>");
    });
    return g.join("");
  }
  function D(e) {
    const g = [],
      h = pa[e.baseTypeId + "-" + e.subTypeId];
    e = fa(e);
    1 == h.isWeapon && g.push(O(e.addedWeaponRange) + U(e.attackRate));
    return g;
  }
  function E(e) {
    const g = [],
      h = fa(e);
    b.each(
      e.compositeImplicits ? e.compositeImplicits : h.implicits,
      function (l, q) {
        g.push(L(q));
      }
    );
    return g;
  }
  function O(e) {
    let g;
    b.isPlainObject(e)
      ? (g =
          '<span class="old-value">' +
          le_a(100 * (e.oldValue + 1.9)) / 100 +
          '</span><span class="new-value">' +
          le_a(100 * (e.value + 1.9)) / 100 +
          "</span>")
      : (g = le_a(100 * (e + 1.9)) / 100);
    return (
      "<div>" +
      (le_.t("item_db.item_card.weapon_range") + " " + X(g)) +
      "</div>"
    );
  }
  function U(e) {
    let g;
    b.isPlainObject(e)
      ? (g =
          '<span class="old-value">' +
          le_a(100 * e.oldValue) / 100 +
          '</span><span class="new-value">' +
          le_a(100 * e.value) / 100 +
          "</span>")
      : (g = le_a(100 * e) / 100);
    return (
      "<div>" +
      (le_.t("item_db.item_card.weapon_base_attack_rate") + " " + X(g)) +
      "</div>"
    );
  }
  function L(e) {
    const g = e.property,
      h = e.type,
      l = e.implicitValue,
      q = e.implicitMaxValue,
      t = e.tags;
    e = e.specialTag;
    const u = va(g, t, e);
    return da(u, g, h, l, q, t, e, ka());
  }
  function R(e) {
    const g = [];
    b.each(e.basicMods, function (h, l) {
      g.push(S(l));
    });
    b.each(e.descriptionParts, function (h, l) {
      g.push(sa(l));
    });
    return g;
  }
  function F(e) {
    const g = [];
    b.each(e.compositeMods, function (h, l) {
      const q = [];
      b.each(l.mods, function (t, u) {
        q.push(S(u));
      });
      h = q.join("<br>");
      l.setAffix &&
        (h +=
          " <span class='text-silver'>per equipped item with this affix</span>");
      g.push({
        Pa: h,
        Ib: l.affixType,
        ze: 1 == l.specialAffixType,
        De: 2 == l.specialAffixType,
        ee: l.tier,
      });
    });
    return g;
  }
  function Z(e) {
    const g = [];
    b.each(e.tooltipEntries, function (h, l) {
      h = l.modDisplay;
      128 > h
        ? e.mods.length > h && g.push(na(e.mods[h]))
        : e.tooltipDescriptions.length > h - 128 &&
          g.push(ta(e, e.tooltipDescriptions[h - 128]));
    });
    return g;
  }
  function V(e, g) {
    const h = [];
    let l = 0;
    b.each(e.tooltipEntries, function (q, t) {
      q = t.modDisplay;
      if (128 > q) {
        if (e.mods.length > q) {
          q = e.mods[q];
          t =
            g && q.setRequirement > g.length
              ? "item-set-mod-disabled"
              : "item-set-mod";
          if (l != q.setRequirement) {
            var u = le_.t("item_db.item_card.set_requirement", {
              count: q.setRequirement,
            });
            h.push(
              '<span class="' +
                t +
                '" style="margin-top: 8px; display: block">' +
                u +
                "</span>"
            );
            l = q.setRequirement;
          }
          h.push(
            '<div class="item-mod-unique" style="margin-left: 16px;"><span class="' +
              t +
              '">' +
              na(q) +
              "</span></div>"
          );
        }
      } else e.tooltipDescriptions.length > q - 128 && ((q = e.tooltipDescriptions[q - 128]), (t = g && q.setRequirement > g.length ? "item-set-mod-disabled" : "item-set-mod"), l != q.setRequirement && ((u = le_.t("item_db.item_card.set_requirement", { count: q.setRequirement })), h.push('<span class="' + t + '" style="margin-top: 8px; display: block">' + u + "</span>"), (l = q.setRequirement)), h.push('<div class="item-mod-unique" style="margin-left: 16px;"><span class="' + t + '">' + ta(e, q) + "</span></div>"));
    });
    return h;
  }
  function S(e, g, h) {
    if (0 == e.hideStatMod || g) {
      g = e.property;
      var l = e.type,
        q = e.value,
        t = e.maxValue,
        u = e.tags;
      e = e.specialTag;
      const y = va(g, u, e);
      h = da(y, g, l, q, t, u, e, ka(), h);
    } else h = "";
    return h;
  }
  function sa(e) {
    let g = "";
    0 == e.setPart && (g = le_Aa(e));
    return g;
  }
  function na(e) {
    if (0 == e.hideInTooltip) {
      var g = null;
      e.canRoll && (g = e.maxValue);
      var h = e.property,
        l = e.type,
        q = e.value,
        t = e.tags;
      e = e.specialTag;
      const u = va(h, t, e);
      return da(u, h, l, q, g, t, e, ka());
    }
    return "";
  }
  function ta(e, g) {
    var h = "";
    if (0 == g.setMod) {
      h = (le_Aa(g) || "").split(/\\n|\n/);
      const l = [];
      b.each(h, function (q, t) {
        l.push('<div class="item-description-part">' + t + "</div>");
      });
      (g = (le_Ba(g) || "").trim()) &&
        l.push('<div class="item-description-part alt">' + g + "</div>");
      h = l.join("");
    }
    h = h.replace(/\[(\d+),\s*(\d+),\s*(\d+)\]/gi, function (l, q, t, u) {
      if (e.useRolledValues && e.uniqueRolls)
        return X(wa(+q + (e.uniqueRolls[+u] / 255) * (+t - +q)));
      l = le_.t("item_db.item_card.property.value_range", {
        value1: X(q),
        value2: X(t),
      });
      return ka().replace("$", `(${l})`);
    });
    h = h.replace(/\(\[(\d+),\s*c,\s*(\d+)\]%?\)/gi, function () {
      return "";
    });
    h = h.replace(/\(\[(\d+),\s*c\]%?\)/gi, function () {
      return "";
    });
    h = h.replace(/\[(\d+),\s*c\]%?/gi, function () {
      return "";
    });
    return h.trim();
  }
  function da(e, g, h, l, q, t, u, y, B) {
    const J = qa(g, t, u);
    if (null != J) {
      q == l && (q = null);
      g == SP.PlayerProperty && 342 == t
        ? (J.displayAddedAsPercentage = 1)
        : g == SP.AbilityProperty && 481 == t && 3 == u
        ? (J.displayAddedAsPercentage = 0)
        : g == SP.AbilityProperty && 481 == t && 5 == u
        ? (J.displayAddedAsPercentage = 1)
        : g == SP.PlayerProperty && 407 == t
        ? (J.displayAddedAsPercentage = 1)
        : g == SP.PlayerProperty && 405 == t
        ? (J.displayAddedAsPercentage = 1)
        : g == SP.PlayerProperty &&
          406 == t &&
          (J.displayAddedAsPercentage = 1);
      e = Pa(e, h, l, q, J, y, B);
      if (g == SP.AbilityProperty || g == SP.PlayerProperty) {
        a: {
          if (J.altTextOverrides) {
            for (let Q = 0, K; (K = J.altTextOverrides[Q]); Q++)
              if (K.modType == h && K.tags == t && K.specialTag == u) {
                g = le_Ka(K);
                break a;
              }
            if (0 != u)
              for (let Q = 0, K; (K = J.altTextOverrides[Q]); Q++)
                if (K.specialTag == u) {
                  g = le_Ka(K);
                  break a;
                }
          }
          g = le_Ka(J);
        }
        g &&
          (e += '<br><span class="item-description-part alt">' + g + "</span>");
      }
      return e;
    }
  }
  function ka() {
    return '<span class="mod-value-wrap">$</span>';
  }
  function X(e) {
    return '<span class="mod-value">' + e + "</span>";
  }
  function Pa(e, g, h, l, q, t, u) {
    let y = "item_db.item_card.property.display_template.base",
      B = !1;
    const J = q.displayAsPercentageOf,
      Q = q.dontDisplayPlus,
      K = q.displayAsAddedTo;
    switch (g) {
      case 0:
        J
          ? (y = "item_db.item_card.property.display_template.of")
          : (0 >= h || Q || (B = !0),
            K && (y = "item_db.item_card.property.display_template.to"));
        break;
      case 1:
        y =
          0 >= h
            ? "item_db.item_card.property.display_template.reduced"
            : "item_db.item_card.property.display_template.increased";
        break;
      case 2:
        y =
          0 >= h
            ? "item_db.item_card.property.display_template.less"
            : "item_db.item_card.property.display_template.more";
    }
    0 != g && (0 > h && (h *= -1), null != l && 0 > l && (l *= -1));
    g = xa(q, g, h, l, u, !0);
    t && (g = t.replace("$", g));
    B && (g = `+${g}`);
    return le_.t(y, { value: g, modDescription: e });
  }
  function xa(e, g, h, l, q, t) {
    return 0 != g || e.displayAddedAsPercentage || e.displayAsPercentageOf
      ? e.displayAddedAsTenthOfValue && 0 == g
        ? null != l
          ? ((e = le_.t("item_db.item_card.property.value_range", {
              value1: X(kb(h, q) + "%"),
              value2: X(kb(l, q) + "%"),
            })),
            t ? "(" + e + ")" : e)
          : X(kb(h, q) + "%")
        : null != l
        ? ((e = le_.t("item_db.item_card.property.value_range", {
            value1: X(wa(100 * h, q) + "%"),
            value2: X(wa(100 * l, q) + "%"),
          })),
          t ? "(" + e + ")" : e)
        : X(wa(100 * h, q) + "%")
      : 0 != g
      ? null != l
        ? ((e = le_.t("item_db.item_card.property.value_range", {
            value1: X(wa(h, q)),
            value2: X(wa(l, q)),
          })),
          t ? "(" + e + ")" : e)
        : X(wa(h, q))
      : null != l
      ? ((e = le_.t("item_db.item_card.property.value_range", {
          value1: X(lb(h, e.roundAddedToInt)),
          value2: X(lb(l, e.roundAddedToInt)),
        })),
        t ? "(" + e + ")" : e)
      : X(lb(h, e.roundAddedToInt));
  }
  function wa(e, g) {
    return g ? Math.tc(e, -2) : le_a(e);
  }
  function kb(e, g) {
    return g ? Math.tc(10 * e, -2) : le_a(100 * e) / 10;
  }
  function lb(e, g) {
    return 1 == g ? le_a(e) : 2 == g ? le_a(10 * e) / 10 : le_a(100 * e) / 100;
  }
  function ib(e) {
    const g = [];
    if (34 == e.baseTypeId) return g;
    if (35 <= e.baseTypeId && 39 >= e.baseTypeId)
      return (e = mb(e)) && g.push(Hb(e, !0)), g;
    var h = ua(e);
    g.push(Ib(h));
    h = fa(e);
    (h = Ra(h)) && g.push(Jb(h));
    (h = Sa(e)) && g.push(Kb(h));
    (e = mb(e)) && g.push(Hb(e));
    return g;
  }
  function Ib(e) {
    e = b.isPlainObject(e)
      ? '<span class="old-value">' +
        e.oldValue +
        '</span><span class="new-value">' +
        e.value +
        "</span>"
      : "<span style='color:#FFF'>" + e + "</span>";
    return (
      '<div class="item-req">' +
      (le_.t("item_db.item_card.level_requirement") + " " + e) +
      "</div>"
    );
  }
  function Ra(e, g, h) {
    g = (null != g ? g : e.classRequirement) || 0;
    e = (null != h ? h : e.subClassRequirement) || 0;
    if (g == le_B.None) return "";
    h = [];
    g & le_B.Primalist && h.push(ia(0, e == le_9c.None ? 0 : e));
    g & le_B.Mage && h.push(ia(1, e == le_9c.None ? 0 : e));
    g & le_B.Sentinel && h.push(ia(2, e == le_9c.None ? 0 : e));
    g & le_B.Acolyte && h.push(ia(3, e == le_9c.None ? 0 : e));
    g & le_B.Rogue && h.push(ia(4, e == le_9c.None ? 0 : e));
    return h.join(" / ");
  }
  function Sa(e, g) {
    g = (null != g ? g : e.classSpecificity) || 0;
    if (g == le_C.None) return "";
    e = [];
    0 != g &&
      (g & le_C.Primalist && e.push(ia(0, 0)),
      g & le_C.Mage && e.push(ia(1, 0)),
      g & le_C.Sentinel && e.push(ia(2, 0)),
      g & le_C.Acolyte && e.push(ia(3, 0)),
      g & le_C.Rogue && e.push(ia(4, 0)),
      g & le_C.NonSpecific &&
        ((g = le_.t("item_db.affix_card.requirement_non_specific")),
        e.push(g)));
    return e.join(" / ");
  }
  function nb(e) {
    let g = !1;
    b.each(e, function (h, l) {
      g || -1 == Ta.indexOf(l) || (g = !0);
    });
    return g;
  }
  function Jb(e) {
    let g;
    b.isPlainObject(e)
      ? ((g = ""),
        e.oldValue &&
          (g += '<span class="old-value">' + e.oldValue + "</span>"),
        e.value && (g += '<span class="new-value">' + e.value + "</span>"))
      : (g = "<span style='color:#FFF'>" + e + "</span>");
    return (
      '<div class="item-req2">' +
      (le_.t("item_db.item_card.class_requirement") + " " + g) +
      "</div>"
    );
  }
  function Kb(e) {
    let g;
    b.isPlainObject(e)
      ? ((g = ""),
        e.oldValue &&
          (g += '<span class="old-value">' + e.oldValue + "</span>"),
        e.value && (g += '<span class="new-value">' + e.value + "</span>"))
      : (g = "<span style='color:#FFF'>" + e + "</span>");
    return (
      '<div class="item-req2">' +
      (le_.t("item_db.item_card.item_class_requirement") + " " + g) +
      "</div>"
    );
  }
  function mb(e) {
    if (null != e.factionReq) return e.factionReq;
    var g = ba(e);
    if (Lb.includes(g)) {
      g = e.implicits[0];
      let h = 1;
      g
        ? ((e = g.specialTag),
          (h =
            0 <= e && 32 >= e
              ? 2
              : 33 <= e && 36 >= e
              ? 3
              : 37 == e
              ? 5
              : 38 <= e && 40 >= e
              ? 4
              : 41 == e
              ? 7
              : 42 == e
              ? 8
              : 43 <= e && 45 >= e
              ? 2
              : 1))
        : console.warn("Lens without any implicit?", e.id);
      return [0, h];
    }
    return null;
  }
  function Hb(e, g) {
    if (e) {
      var [h, l] = e,
        q = a.factionList && a.factionList[h];
      if (null != q) {
        e = le_b(q.factionNameKey);
        var t = "";
        null != l &&
          ((t = le_.t("item_db.item_card.faction_requirement.rank", {
            num: l,
          })),
          (t = ` (${t})`));
        q = q.factionIcon.substr(2);
        var u = Mb(h);
        e =
          "<span class='faction-name'><span class='faction-name-icon'>" +
          `<span class='f_icons f_icons-${q}'></span>` +
          "</span>" +
          `<a href="${u}">${e}</a>${t}` +
          "</span>";
        return (
          `<div class="${g ? "item-req" : "item-req2"}">` +
          (le_.t("item_db.item_card.faction_requirement") + " " + e) +
          "</div>"
        );
      }
    }
  }
  function Mb(e) {
    switch (e) {
      case 0:
        return `${le_c("/guide")}/section/circle_of_fortune`;
      case 1:
        return `${le_c("/guide")}/section/merchants_guild`;
      default:
        return "";
    }
  }
  function Db(e) {
    let g = "";
    var h = aa[e.baseTypeId];
    h && (g = le_d(h));
    if (null != e.uniqueId) {
      h = fa(e);
      if (null == h) return console.error("base not found for item", e), g;
      let l = null;
      switch (T(e)) {
        case 7:
          l = "item_db.item_card.unique_item_name";
          break;
        case 8:
          l = "item_db.item_card.set_item_name";
          break;
        case 9:
          l = "item_db.item_card.legendary_item_name";
      }
      l &&
        ((e = le_
          .t(l, { itemName: le_d(h) })
          .replace(/<a>([^<]+)<\/a>/i, `<a item-id="${h.id}">$1</a>`)),
        (g += "<br>" + e));
    }
    return g;
  }
  function hb(e) {
    const g = [];
    b.each(rc(e), function (h, l) {
      l && g.push("<li>" + l + "</li>");
    });
    return (
      '<div class="affix-applies-to">' +
      le_.t("item_db.affix_card.can_be_applied_to") +
      '</div><ul class="affix-applies-to-list">' +
      g.join("") +
      "</ul>"
    );
  }
  function rc(e) {
    const g = [];
    if (e) {
      var h = [];
      for (var l = 0; l < e.length; l++) Ua[e[l]] || h.push(e[l]);
      e = h;
      if (e.length == ob.length)
        g.push(le_.t("item_db.affix_card.applies_to_any_item"));
      else
        for (
          e.Dd(Nb) &&
            ((e = e.diff(Nb)),
            g.push(le_.t("item_db.affix_card.applies_to_any_armor"))),
            e.Dd(Ob) &&
              ((e = e.diff(Ob)),
              g.push(le_.t("item_db.affix_card.applies_to_any_accessory"))),
            h = 0;
          h < e.length;
          h++
        ) {
          l = e[h];
          let q = "";
          b.isPlainObject(l)
            ? (null != l.oldValue &&
                (q += '<span class="old-value">' + Ga(l.oldValue) + "</span>"),
              null != l.value &&
                (q += '<span class="new-value">' + Ga(l.value) + "</span>"))
            : (q = Ga(l));
          g.push(q);
        }
    }
    return g;
  }
  function Cb(e) {
    let g;
    b.isPlainObject(e)
      ? (g =
          '<span class="old-value">' +
          (e.oldValue || "-") +
          '</span><span class="new-value">' +
          (e.value || "-") +
          "</span>")
      : (g = e || "-");
    return '<div class="affix-title">' + g + "</div>";
  }
  function Eb(e, g, h) {
    let l = [];
    l.push(
      '<div class="tier-values">' +
        le_.t(
          null == h
            ? "item_db.affix_card.base_values"
            : "item_db.affix_card.scaled_values"
        ) +
        "</div>"
    );
    l.push('<div class="tooltip-skill-params tier-table">');
    let q = "";
    b.each(e.affixProperties, function (y, B) {
      (y = Ha(e, B)) && (y += "<br>");
      y += '<span class="mod-type">' + pb(B.modifierType) + "</span>";
      q += '<div class="affix-tier-range">' + y + "</div>";
    });
    const t = [];
    t.push(
      '<div class="affix tier-header"><div class="affix-tier-name"></div>' +
        q +
        "</div>"
    );
    const u = null == h ? null : aa[h].affixEffectModifier;
    b.each(g, function (y, B) {
      y += 1;
      const J = le_.t("item_db.affix_card.affix_tier", { num: y });
      let Q = "";
      b.each(B.rolls, function (K, M) {
        const P = e.affixProperties[K];
        if (P) {
          const ea = qa(P.property, P.tags, P.specialTag);
          if (ea) {
            const ha = qb(P.property);
            if (null != M.oldValue) {
              var W = ca(e, M.oldValue.min, u, K, ha);
              const ya = ca(e, M.oldValue.max, u, K, ha),
                Va = ca(e, M.value.min, u, K, ha);
              K = ca(e, M.value.max, u, K, ha);
              Q +=
                '<div class="affix-tier-range"><span class="old-value">' +
                xa(ea, P.modifierType, W, ya, !1, !1, !0) +
                "</span>" +
                (1 < B.rolls.length ? "<br/>" : "") +
                '<span class="new-value">' +
                xa(ea, P.modifierType, Va, K, !1, !1, !0) +
                "</span></div>";
            } else
              (W = ca(e, M.min, u, K, ha)),
                (K = ca(e, M.max, u, K, ha)),
                (Q +=
                  '<div class="affix-tier-range">' +
                  xa(ea, P.modifierType, W, K, !1, !1, !0) +
                  "</div>");
          }
        }
      });
      t.push(
        '<div class="affix" tier="' +
          y +
          '"><div class="affix-tier-name">' +
          J +
          "</div>" +
          Q +
          "</div>"
      );
    });
    l = l.concat(t.join(""));
    l.push("</div>");
    return l.join("");
  }
  function Pb(e, g, h, l, q, t) {
    l = aa[l].affixEffectModifier;
    const u = e.tiers[g].rolls[h];
    g = ca(e, u.min, l, h, q, t);
    e = ca(e, u.max, l, h, q, t);
    e == g && (e = null);
    return { min: g, max: e };
  }
  function pb(e) {
    switch (e) {
      case 0:
        return le_.t("item_db.item_card.property.mod_type.added");
      case 1:
        return le_.t("item_db.item_card.property.mod_type.increased");
      case 2:
        return le_.t("item_db.item_card.property.mod_type.more");
      case 3:
        return le_.t("item_db.item_card.property.mod_type.quotient");
    }
    return "";
  }
  function Qb(e) {
    return 0 == e
      ? le_.t("item_db.item_card.type.prefix")
      : le_.t("item_db.item_card.type.suffix");
  }
  function ca(e, g, h, l, q, t) {
    null == h && (h = 0);
    g *=
      1 +
      (q && h != e.standardAffixEffectModifier
        ? (h + 1) / (e.standardAffixEffectModifier + 1) - 1
        : 0);
    if (t) return g;
    e = e.affixProperties[l];
    if (0 == e.modifierType && (e = qa(e.property, e.tags, e.specialTag))) {
      if (1 == e.roundAddedToInt) return le_a(g);
      if (2 == e.roundAddedToInt) return le_a(10 * g) / 10;
    }
    return le_a(100 * g) / 100;
  }
  function qa(e, g, h) {
    if (e == SP.AbilityProperty) {
      var l;
      for (let q = 0, t; (t = coreDB.abilityPropertyList[q++]); )
        if (t.abilityID == g) {
          h < t.properties.length && (l = t.properties[h]);
          break;
        }
      return null == l
        ? (console.error("no ability property for", e, g, h), null)
        : l;
    }
    if (e == SP.PlayerProperty)
      return (
        (l = coreDB.playerPropertyList[g]),
        null == l ? (console.error("no player property for", e, g, h), null) : l
      );
    g = rb[e];
    if (null == g) {
      g = h = !1;
      switch (e) {
        case SP.NegativeArmour:
        case SP.FreezeAvoidance:
        case SP.ManaDrain:
        case SP.WardDecayThreshold:
          h = !0;
          break;
        case SP.NegativePhysicalResistance:
        case SP.NegativeFireResistance:
        case SP.NegativeColdResistance:
        case SP.NegativeLightningResistance:
        case SP.NegativeVoidResistance:
        case SP.NegativeNecroticResistance:
        case SP.NegativePoisonResistance:
        case SP.NegativeElementalResistance:
        case SP.IncreasedChanceToBeStunned:
        case SP.IncreasedChanceToBeFrozen:
        case SP.DamageTakenBuff:
        case SP.EffectOfAilmentOnYou:
        case le_Zc.IncreasedCompanionReviveSpeed:
        case le_Zc.IncreasedCompanionReviveRange:
        case le_Zc.DoubleDamageChance:
          g = h = !0;
      }
      h
        ? ((h = b.extend(!0, [], coreDB.defaultProperty)),
          (h.isDefault = !0),
          (h.property = e),
          g && (h.displayAddedAsPercentage = 1),
          (e = h))
        : (e = null);
    } else e = g;
    return e;
  }
  function Rb(e) {
    switch (e) {
      case 0:
        return "physical";
      case 1:
        return "fire";
      case 2:
        return "cold";
      case 3:
        return "lightning";
      case 4:
        return "necrotic";
      case 5:
        return "void";
      case 6:
        return "poison";
      default:
        return "";
    }
  }
  function sb(e) {
    switch (e) {
      case 0:
        return le_.t("planner.damage_types.physical");
      case 1:
        return le_.t("planner.damage_types.fire");
      case 2:
        return le_.t("planner.damage_types.cold");
      case 3:
        return le_.t("planner.damage_types.lightning");
      case 4:
        return le_.t("planner.damage_types.necrotic");
      case 5:
        return le_.t("planner.damage_types.void");
      case 6:
        return le_.t("planner.damage_types.poison");
      default:
        return "";
    }
  }
  function Sb(e) {
    switch (e) {
      case 0:
        return "melee";
      case 1:
        return "spell";
      case 2:
        return "bow";
      case 3:
        return "throwing";
      case 4:
        return "dot";
      default:
        return "";
    }
  }
  function va(e, g, h) {
    if (e == SP.AbilityProperty || e == SP.PlayerProperty)
      return le_Ja(qa(e, g, h));
    let l = "";
    if (e == le_Zc.IncreasedCompanionReviveSpeed)
      return "Increased Companion Revive Speed";
    if (e == le_Zc.IncreasedCompanionReviveRange)
      return "Increased Companion Revive Range";
    if (e == le_Zc.DoubleDamageChance) return "Double Damage Chance";
    if (e == SP.ManaDrain) return "Mana Drain";
    if (e == SP.IncreasedChanceToBeStunned)
      return "Increased Chance To Be Stunned";
    if (e == SP.IncreasedChanceToBeFrozen)
      return "Increased Chance To Be Frozen";
    if (e == SP.IncreasedStunChance && ((l += "Increased"), g == AT.None))
      return "Increased Stun Chance";
    if (e == SP.IncreasedStunDuration && ((l += "Increased"), g == AT.None))
      return "Increased Stun Duration";
    if (e == SP.IncreasedDropRate) return sc(g, h);
    if (e == SP.LevelOfSkills) return tc(g, h);
    switch (e) {
      case SP.EffectOfAilmentOnYou:
        return (g = la(h)), "Increased Effect of " + le_g(g) + " on You";
      case SP.AilmentConversion:
        return (
          (e = la(h)),
          (g = la(g)),
          le_g(e) + " Chance Converted to " + le_g(g) + " Chance"
        );
      case SP.AilmentChance:
        var q = la(h);
        l += "Chance to ";
        0 != q.applyPrefix && (l += 1 == q.applyPrefix ? "apply " : "apply a ");
        q = le_g(q);
        l = "" == q ? l + uc(h) : l + q;
        l += " on";
        break;
      case SP.HealthGain:
        l += "Health Gain on";
        break;
      case SP.ManaGain:
        l += "Mana Gain on";
        break;
      case SP.WardGain:
        l += "Ward Gain on";
        break;
      case SP.CircleOfFortuneLensEffect:
        return vc(h);
      case SP.IncreasedAreaForAreaSkills:
        if (g == AT.None) g = "";
        else {
          const t = [];
          g = za(g);
          b.each(g, function (u, y) {
            (u = Wa(y)) && t.push(u);
          });
          g = t.join(" ") + " ";
        }
        return "Increased Area for " + g + "Area Skills";
      case SP.NegativeArmour:
        return "Negative Armour";
      case SP.NegativePhysicalResistance:
        return "Negative Physical Resistance";
      case SP.NegativeFireResistance:
        return "Negative Fire Resistance";
      case SP.NegativeColdResistance:
        return "Negative Cold Resistance";
      case SP.NegativeLightningResistance:
        return "Negative Lightning Resistance";
      case SP.NegativeVoidResistance:
        return "Negative Void Resistance";
      case SP.NegativeNecroticResistance:
        return "Negative Necrotic Resistance";
      case SP.NegativePoisonResistance:
        return "Negative Poison Resistance";
      case SP.NegativeElementalResistance:
        return "Negative Elemental Resistance";
      case SP.DamageTakenBuff:
        return "Damage Taken";
    }
    e == SP.ManaCost &&
      g & AT.DoT &&
      ("" != l && (l += " "), (l += "Damage Over Time"));
    g & AT.Minion && ("" != l && (l += " "), (l += "Minion"));
    q = za(g & (AT.Spell | AT.Melee | AT.Throwing | AT.Bow));
    b.each(q, function (t, u) {
      "" != l && (l += " ");
      l += tb(u);
    });
    q = za(
      g &
        ~(
          AT.Minion |
          AT.Spell |
          AT.Melee |
          AT.Throwing |
          AT.Bow |
          AT.DoT |
          AT.Totem |
          AT.Channelling |
          AT.Transform |
          AT.Potion |
          AT.LowLife |
          AT.HighLife |
          AT.FullLife |
          AT.Dodge_deprecated |
          AT.Crit_deprecated |
          AT.Kill_deprecated |
          AT.Die_deprecated
        )
    );
    b.each(q, function (t, u) {
      "" != l && (l += " ");
      l += tb(u);
    });
    e == SP.ManaCost && g & AT.Totem && ("" != l && (l += " "), (l += "Totem"));
    "" != l && (l += " ");
    switch (e) {
      case SP.Damage:
        l = g & AT.DoT ? l + "Damage Over Time" : l + "Damage";
        break;
      case SP.GlobalConditionalDamage:
        l = g & AT.DoT ? l + "Damage Over Time" : l + "Damage";
        (h = wc(h)) && (l += " " + h);
        break;
      default:
        if (
          (g & AT.DoT && e != SP.ManaCost && (l += "Damage Over Time "),
          (q = qa(e, g, h)),
          null == q || q.isDefault)
        )
          l += xc(e);
        else {
          q = !1;
          if (0 != h)
            switch (e) {
              case SP.AilmentChance:
                l += "Hit";
                q = !0;
                break;
              case SP.IncreasedAilmentDuration:
                l += "Increased " + le_g(la(h)) + " Duration";
                q = !0;
                break;
              case SP.IncreasedAilmentEffect:
                q = la(h);
                l =
                  0 == q.effectOfIncreasedEffectiveness ||
                  null == q.effectOfIncreasedEffectiveness
                    ? l + ("Increased " + le_g(la(h)) + " Effect")
                    : l +
                      (sb(q.additionalPenetrationDamageType) +
                        " Penetration with " +
                        le_g(q));
                q = !0;
                break;
              case SP.HealthLeech:
                l += "Damage Leeched as Health on " + ja(h);
                q = !0;
                break;
              case SP.DamageTaken:
                l = g & AT.DoT ? l + "Taken" : l + "Damage Taken";
                l += " on " + ja(h);
                q = !0;
                break;
              case SP.DamageTakenAsPhysical:
                l =
                  g & AT.DoT
                    ? l + "Taken as Physical"
                    : l + "Damage Taken as Physical";
                l += " on " + ja(h);
                q = !0;
                break;
              case SP.DamageTakenAsCold:
                l =
                  g & AT.DoT ? l + "Taken as Cold" : l + "Damage Taken as Cold";
                l += " on " + ja(h);
                q = !0;
                break;
              case SP.DamageTakenAsFire:
                l =
                  g & AT.DoT ? l + "Taken as Fire" : l + "Damage Taken as Fire";
                l += " on " + ja(h);
                q = !0;
                break;
              case SP.DamageTakenAsLightning:
                l =
                  g & AT.DoT
                    ? l + "Taken as Lightning"
                    : l + "Damage Taken as Lightning";
                l += " on " + ja(h);
                q = !0;
                break;
              case SP.DamageTakenAsVoid:
                l =
                  g & AT.DoT ? l + "Taken as Void" : l + "Damage Taken as Void";
                l += " on " + ja(h);
                q = !0;
                break;
              case SP.DamageTakenAsNecrotic:
                l =
                  g & AT.DoT
                    ? l + "Taken as Necrotic"
                    : l + "Damage Taken as Necrotic";
                l += " on " + ja(h);
                q = !0;
                break;
              case SP.DamageTakenAsPoison:
                l =
                  g & AT.DoT
                    ? l + "Taken as Poison Damage"
                    : l + "Damage Taken as Poison Damage";
                l += " on " + ja(h);
                q = !0;
                break;
              case SP.DamagePerStackOfAilment:
                q = "Damage";
                if (g != AT.None) {
                  const t = [];
                  q = za(g);
                  b.each(q, function (u, y) {
                    (u = Wa(y)) && t.push(u);
                  });
                  q = t.join(" ") + " Damage";
                }
                l = q + " per stack of " + le_g(la(h));
                q = !0;
            }
          else
            switch (e) {
              case SP.DamageTaken:
                l = g & AT.DoT ? l + "Taken" : l + "Damage Taken";
                q = !0;
                break;
              case SP.DamageTakenAsPhysical:
                l =
                  g & AT.DoT
                    ? l + "Taken as Physical"
                    : l + "Damage Taken as Physical";
                q = !0;
                break;
              case SP.DamageTakenAsCold:
                l =
                  g & AT.DoT ? l + "Taken as Cold" : l + "Damage Taken as Cold";
                q = !0;
                break;
              case SP.DamageTakenAsFire:
                l =
                  g & AT.DoT ? l + "Taken as Fire" : l + "Damage Taken as Fire";
                q = !0;
                break;
              case SP.DamageTakenAsLightning:
                l =
                  g & AT.DoT
                    ? l + "Taken as Lightning"
                    : l + "Damage Taken as Lightning";
                q = !0;
                break;
              case SP.DamageTakenAsVoid:
                l =
                  g & AT.DoT ? l + "Taken as Void" : l + "Damage Taken as Void";
                q = !0;
                break;
              case SP.DamageTakenAsNecrotic:
                l =
                  g & AT.DoT
                    ? l + "Taken as Necrotic"
                    : l + "Damage Taken as Necrotic";
                q = !0;
                break;
              case SP.DamageTakenAsPoison:
                (l =
                  g & AT.DoT
                    ? l + "Taken as Poison Damage"
                    : l + "Damage Taken as Poison Damage"),
                  (q = !0);
            }
          q ||
            0 == h ||
            -1 == le_4c.indexOf(e) ||
            -1 != le_5c.indexOf(e) ||
            ("" != l && " " != l[l.length - 1] && (l += " "),
            (l += ja(h)),
            (q = !0));
          q || (l += le_Ja(qa(e, g, h)));
        }
      case SP.IncreasedStunChance:
      case SP.IncreasedStunDuration:
    }
    q = za(
      g &
        (AT.Potion |
          AT.LowLife |
          AT.HighLife |
          AT.FullLife |
          AT.Dodge_deprecated |
          AT.Crit_deprecated |
          AT.Kill_deprecated |
          AT.Die_deprecated)
    );
    b.each(q, function (t, u) {
      "" != l && (l += " ");
      l += tb(u);
    });
    e == SP.IncreasedStunChance && (l += " Stun Chance");
    e == SP.IncreasedStunDuration && (l += "Stun Duration");
    e != SP.ManaCost &&
      g & AT.Totem &&
      ("" != l && (l += " "), (l += "for Totems"));
    g & AT.Channelling && ("" != l && (l += " "), (l += "While Channelling"));
    g & AT.Transform && ("" != l && (l += " "), (l += "While Transformed"));
    return l;
  }
  function tb(e) {
    switch (e) {
      case AT.Totem:
        return "for totems";
      case AT.Potion:
        return "for 4 seconds when you use a Potion";
      case AT.FullLife:
        return "while at Full Health";
      case AT.HighLife:
        return "while at High Health";
      case AT.LowLife:
        return "while at Low Health";
      default:
        return Wa(e) || "";
    }
  }
  function wc(e) {
    return null != coreDB.conditionalDamagePropertyDescriptionKeys
      ? le_b(coreDB.conditionalDamagePropertyDescriptionKeys[e])
      : null != coreDB.conditionalDamagePropertyDescriptions
      ? coreDB.conditionalDamagePropertyDescriptions[e]
      : "";
  }
  function ma(e, g, h, l) {
    const q = e.findIndex(function (t) {
      return t == g;
    });
    -1 != q && (h.push(l), e.splice(q, 1));
  }
  function yc(e) {
    switch (e) {
      case AT.Minion:
        return "minion";
      case AT.Fire:
        return "fire";
      case AT.Cold:
        return "cold";
      case AT.Lightning:
        return "lightning";
      case AT.Poison:
        return "poison";
      case AT.Necrotic:
        return "necrotic";
      case AT.Void:
        return "void";
      case AT.Physical:
        return "physical";
      case AT.Elemental:
        return "elemental";
      case AT.Curse:
        return "curse";
      case AT.Buff:
        return "buff";
      case AT.Totem:
        return "totem";
      case AT.Bow:
        return "bow";
      case AT.DoT:
        return "dot";
      case AT.Melee:
        return "melee";
      case AT.Spell:
        return "spell";
      case AT.Throwing:
        return "throwing";
    }
  }
  function za(e) {
    const g = [];
    if (0 == e) return g;
    b.each(AT, function (h, l) {
      0 != l && e & l && g.push(l);
    });
    return g;
  }
  function Wa(e) {
    for (let g in AT) if (AT.hasOwnProperty(g) && AT[g] == e) return g;
    return null;
  }
  function xc(e) {
    for (let g in SP)
      if (SP.hasOwnProperty(g) && SP[g] == e) return g.replace(Tb, " $1");
    return null;
  }
  function ja(e) {
    for (let g in le_1c)
      if (le_1c.hasOwnProperty(g) && le_1c[g] == e)
        return g.replace(Tb, " $1").trim();
    return null;
  }
  function uc(e) {
    for (let g in AilmentID)
      if (AilmentID.hasOwnProperty(g) && AilmentID[g] == e) return g;
    return null;
  }
  function la(e) {
    return LEAbilities.ailmentList["" + e];
  }
  function ia(e, g, h = !0) {
    return le_Pa(e, g, h);
  }
  function zc(e) {
    switch (e) {
      case 0:
        return "primalist";
      case 1:
        return "mage";
      case 2:
        return "sentinel";
      case 3:
        return "acolyte";
      case 4:
        return "rogue";
    }
  }
  function Ac(e) {
    switch (e) {
      case 0:
        return "strength";
      case 1:
        return "vitality";
      case 2:
        return "intelligence";
      case 3:
        return "dexterity";
      case 4:
        return "attunement";
    }
  }
  function Ca(e) {
    null != e.affixId
      ? null != e.useGeneratedName
        ? (null == e.Hc &&
            ((e.Hc = e.useGeneratedName ? Ha(e, e.affixProperties[0]) : Ia(e)),
            (e.Hc = le_qa(e.Hc))),
          (e = e.Hc))
        : (e = Ia(e))
      : (e = le_d(e));
    return e;
  }
  function Ia(e) {
    const g = le_Da(e) || (null != e.affixName ? e.affixName : null) || "";
    if (g) return g;
    let h = [];
    e.affixProperties.forEach(function (l) {
      h.push(Ha(e, l));
    });
    return h.join(" / ");
  }
  function Ha(e, g) {
    e = g.useGeneratedName
      ? va(g.property, g.tags, g.specialTag) || le_Fa(g) || Ia(e) || ""
      : le_Fa(g) || va(g.property, g.tags, g.specialTag) || Ia(e) || "";
    return le_qa(e);
  }
  function oa(e, g, h, l) {
    if (!g && !h) {
      g = [];
      h = Ca(e);
      const q = ub(e);
      g.push(`${q}="${e.id}"`);
      e.personalItemId && g.push(`personal-item-id="${e.personalItemId}"`);
      return `<a class="item-name rarity${l}" ${g.join(" ")}>${h}</a>`;
    }
  }
  function Ja(e, g) {
    const h = Ca(e),
      l = ub(e),
      q = T(e);
    let t;
    "item-id" == l && (t = "items/" + e.id);
    "prefix-id" == l && (t = "prefixes/" + e.id);
    "suffix-id" == l && (t = "suffixes/" + e.id);
    "item-set-id" == l && (t = "itemsets/" + e.id);
    let u = "";
    g && (u = ' target="_blank"');
    return `<a class="item-name item-link rarity${q}" ${l}="${
      e.id
    }" href="${`${le_c("/db/")}/${t}`}"${u}>${h}</a>`;
  }
  function ub(e) {
    return le_t[e.id]
      ? "prefix-id"
      : le_u[e.id]
      ? "suffix-id"
      : le_hb[e.id]
      ? "item-set-id"
      : "item-id";
  }
  function ba(e) {
    return e.baseTypeId;
  }
  function ua(e, g, h) {
    g = null != g ? g : e.levelRequirement;
    e.compositeMods ||
      null == e.uniqueId ||
      0 != e.overrideLevelRequirement ||
      (g = (e = fa(e)) ? e.levelRequirement : null);
    return h ? g || 0 : g || 1;
  }
  function fa(e) {
    let g = e;
    null != e.subTypeIds
      ? (g = Da[e.id])
      : null != e.uniqueId && (g = Da[e.baseTypeId + "-" + e.subTypeId]);
    return g;
  }
  function Gb(e) {
    return e && -1 != Ta.indexOf(ba(e));
  }
  function T(e) {
    return e.compositeRarity ? e.compositeRarity : e.rarity;
  }
  function Ga(e) {
    return "ItemSet" == e
      ? le_.t("item_db.category.item_sets")
      : "ItemPrefix" == e
      ? le_.t("item_db.category.item_prefixes")
      : "ItemSuffix" == e
      ? le_.t("item_db.category.item_suffixes")
      : "ItemGroupEquipment" == e
      ? le_.t("item_db.category.equipment")
      : "ItemGroupIdol" == e
      ? le_.t("item_db.category.idols")
      : "ItemGroupLenses" == e
      ? le_.t("item_db.category.lenses")
      : Xa["" + e];
  }
  function Fb(e, g, h) {
    const l = [],
      q = e.setMembers;
    for (let u = 0, y; (y = q[u]); u++) {
      var t = le_r[y];
      t &&
        ((t = t.id),
        t == g
          ? l.push(
              '<div><span class="item-set-part grayed-out" item-id="' +
                t +
                '">' +
                Ca(le_r[t]) +
                "</span></div>"
            )
          : l.push(
              '<div><a class="item-set-part ' +
                (h && -1 == h.indexOf(t) ? "grayed-out" : "") +
                '" item-id="' +
                t +
                '">' +
                Ca(le_r[t]) +
                "</a></div>"
            ));
    }
    e = V(e, h);
    l.push('<div class="item-padded-v">' + e.join("") + "</div>");
    return l;
  }
  function Ub(e) {
    return null != e.baseTypeId
      ? ((e = aa[e.baseTypeId].size), Math.max(2, e.x) + "x" + Math.max(2, e.y))
      : "hidden";
  }
  function Ya(e) {
    return null != e.baseTypeId ? aa[e.baseTypeId].size : null;
  }
  function Vb(e) {
    if (
      null != e.uniqueId &&
      e.subTypeIds &&
      itemDB.fracturedUniques[e.uniqueId]
    ) {
      e = le_r.IIzAMCZVBWLSA;
      e = '<span class="item-crafting">' + oa(e, null, null, T(e)) + "</span>";
      var g = le_r.IIwBjIJgZnI;
      g = oa(g, null, null, T(g));
      var h = le_t.AAwZgLEA;
      h = '<span class="item-affix">' + oa(h, null, null, T(h)) + "</span>";
      var l = le_t.AAwVgzEA;
      l = '<span class="item-affix">' + oa(l, null, null, T(l)) + "</span>";
      e =
        '<li class="text-fractured-unique">' +
        le_.t("item_db.item_card.drop_info.fractured_item_obtain_method", {
          runeName: e,
          itemName: g,
          prefix1Name: h,
          prefix2Name: l,
          affixTierCount: '<span class="class="text-white">21+</span>',
        }) +
        "</li>";
      return (
        '<div class="title">' +
        le_.t("item_db.item_card.drop_info.obtained_from") +
        "</div><ul>" +
        e +
        "</ul>"
      );
    }
  }
  function Wb(e) {
    if (102 == e.baseTypeId && 7 == e.subTypeId)
      return (
        (e =
          "<li>" +
          le_.t(
            "item_db.item_card.drop_info.rune_of_research_obtain_method",
            {},
            "text-silver"
          ) +
          "</li>"),
        '<div class="title">' +
          le_.t("item_db.item_card.drop_info.obtained_from") +
          "</div><ul>" +
          e +
          "</ul>"
      );
  }
  function Xb(e) {
    if (e.personalItemDropInfo)
      return (
        (e = "<li>" + e.personalItemDropInfo + "</li>"),
        '<div class="title">' +
          le_.t("item_db.item_card.drop_info.personal_item_obtained_from") +
          "</div><ul>" +
          e +
          "</ul>"
      );
  }
  function Yb(e) {
    e = e.uniqueId;
    if ((e = null != e && Za[e]))
      return (
        (e = "<li>" + Zb(e) + "</li>"),
        '<div class="title">' +
          le_.t("item_db.item_card.drop_info.obtained_from") +
          "</div><ul>" +
          e +
          "</ul>"
      );
  }
  function $b(e) {
    if ((e = $a[e.baseTypeId + "-" + e.subTypeId]))
      return (
        (e = "<li>" + vb(e) + "</li>"),
        '<div class="title">' +
          le_.t("item_db.item_card.drop_info.obtained_from") +
          "</div><ul>" +
          e +
          "</ul>"
      );
  }
  function ac(e) {
    e = ab[e.baseTypeId + "-" + e.subTypeId];
    if (null != e && null != a.factionList) return a.factionList[e];
  }
  function bc(e) {
    e = ac(e);
    if (null != e)
      return (
        (e =
          '<li class="text-faction-gambler">' +
          le_
            .t("item_db.item_card.drop_info.faction_gambler", {
              factionName: le_b(e.factionNameKey),
            })
            .replace(
              /<a>([^<]+)<\/a>/i,
              `<a href="${Mb(e.factionId)}">$1</a>`
            )),
        "</li>",
        '<div class="title">' +
          le_.t("item_db.item_card.drop_info.obtained_from") +
          "</div><ul>" +
          e +
          "</ul>"
      );
  }
  function cc(e) {
    e = e.uniqueId;
    const g = null != e && itemDB.monsterDrops[e];
    if (g) {
      var h = "";
      for (let Q = 0; Q < g.length; Q++) {
        var l = g[Q],
          q = l.zoneLevel,
          t = l.timelineInfo,
          u = l.dungeonInfo;
        const K = l.chancePerTier,
          M = l.minCorruption;
        let P = le_Ia(l);
        const W = l.arena || 0 == P.indexOf("Arena ");
        var y = l.runePrison,
          B = [];
        if (t) {
          var J = le_.t("item_db.item_card.drop_info.timeline_to_farm_name", {
            name: le_Oa(timelineData[t.id]),
          });
          J = '<a class="timeline" timeline-id="' + t.id + '">' + J + "</a>";
          t.empoweredOnly &&
            (J +=
              ", " +
              le_.t("item_db.item_card.drop_info.timeline_empowered_only"));
          B.push(`(${J})`);
        }
        u &&
          ((J = le_.t("item_db.item_card.drop_info.dungeon_name", {
            name: le_Na(dungeonData[u.id]),
          })),
          B.push(
            `(${'<a class="dungeon" dungeon-id="' + u.id + '">' + J + "</a>"})`
          ));
        W &&
          ((u = le_.t("item_db.item_card.drop_info.arena")),
          B.push(`(${'<a class="arena" arena-id="-">' + u + "</a>"})`));
        y &&
          ((y = le_.t("item_db.item_card.drop_info.rune_prison_encounters")),
          B.push(`(${y})`));
        if (K) {
          const ea = [];
          b.each(K, function (ha, ya) {
            ya = X(le_a(1e4 * ya) / 100 + "%");
            let Va;
            Va =
              W && 4 == ha
                ? le_.t("item_db.item_card.drop_info.endless_arena_tier")
                : le_.t("item_db.item_card.drop_info.dungeon_arena_tier", {
                    num: ha + 1,
                  });
            ea.push(
              `<div class="drop-tier" tier="${ha}">` + Va + ": " + ya + "</div>"
            );
          });
          B.push('<div class="drop-list">' + ea.join("") + "</div>");
        }
        q &&
          (q.from && q.to
            ? ((q = le_.t("item_db.item_card.drop_info.zone_level_from_to", {
                from: q.from,
                to: q.to,
              })),
              B.push(`(${q})`))
            : q.from
            ? ((q = le_.t("item_db.item_card.drop_info.zone_level_from", {
                from: q.from,
              })),
              B.push(`(${q})`))
            : q.to &&
              ((q = le_.t("item_db.item_card.drop_info.zone_level_to", {
                to: q.to,
              })),
              B.push(`(${q})`)));
        M &&
          !t &&
          ((t = le_.t("item_db.item_card.drop_info.minimum_corruption")),
          B.push(`(${t} ${M})`));
        0 < B.length &&
          (P += ' <span class="text-silver">' + B.join(" ") + "</span>");
        l.rarity
          ? ((B = bb(l.rarity)),
            l.chance && (B += ", " + dc(l.chance)),
            (P += ' - <span class="rarity-value">' + B + "</span>"))
          : l.chance &&
            (P += ' - <span class="rarity-value">' + dc(l.chance) + "</span>");
        if (M || 208 == e)
          (l = le_.t(
            "item_db.item_card.drop_info.drop_rate_depends_on_corruption"
          )),
            (P +=
              ' <div class="text-silver" style="padding-top:2px">' +
              l +
              "</div>");
        h += '<li class="text-monster">' + P + "</li>";
      }
      return (
        '<div class="title">' +
        le_.t("item_db.item_card.drop_info.dropped_from") +
        "</div><ul>" +
        h +
        "</ul>"
      );
    }
  }
  function dc(e) {
    return le_.t("item_db.item_card.drop_info.drop_chance", {
      value: le_a(1e4 * e) / 100,
    });
  }
  function ec(e) {
    var g = null != e.uniqueId && itemDB.questRewards[e.uniqueId];
    if (g) {
      e = le_;
      var h = e.t;
      g = null != g.titleKey ? le_b(g.titleKey) : g.title;
      return h.call(
        e,
        "item_db.item_card.drop_info.quest_reward",
        { name: g },
        "title"
      );
    }
  }
  function qc(e) {
    const g = [],
      h = e.subTypeId;
    b.each(timelineData, function (l, q) {
      b.each(q.difficulties, function (t, u) {
        let y = !1;
        b.each(u.firstSlotBlessings, function (B, J) {
          J == h && (y = !0);
        });
        b.each(u.otherSlotBlessings, function (B, J) {
          J == h && (y = !0);
        });
        b.each(u.anySlotBlessings, function (B, J) {
          J == h && (y = !0);
        });
        y &&
          ((t = le_.t("item_db.blessing_card.timeline_level", {
            value: u.level,
          })),
          g.push(
            '<span class="text-timelines"><a class="timeline" timeline-id="' +
              l +
              '">' +
              le_Oa(q) +
              "</a>" +
              ` (${t})` +
              "</span>"
          ));
      });
    });
    if (0 < g.length)
      return le_.t("item_db.blessing_card.timeline") + " " + g.join("");
    console.error("No timeline for blessing " + h);
  }
  function Bc(e, g) {
    if (
      (e = Ea[e.baseTypeId + "-" + e.subTypeId]) &&
      0 < Object.keys(e).length
    ) {
      const h = [];
      b.each(e, function (q, t) {
        h.push(t);
      });
      h.sort(function (q, t) {
        const u = T(q),
          y = T(t);
        if (u != y) return u - y;
        q = le_d(q).toLowerCase();
        t = le_d(t).toLowerCase();
        return q.localeCompare(t);
      });
      const l = [];
      b.each(h, function (q, t) {
        q = T(t);
        l.push("<li>" + oa(t, null, null, q) + "</li>");
      });
      return (
        '<div class="title">' +
        le_.t(
          g
            ? "item_db.item_card.only_used_as_base_item"
            : "item_db.item_card.used_as_base_item"
        ) +
        "</div><ul>" +
        l.join("") +
        "</ul>"
      );
    }
  }
  function cb(e, g) {
    const h = le_.t("item_db.item_card.random_drop"),
      l = le_.t("item_db.item_card.reroll_chance");
    g =
      null != g
        ? `<span class="hover-text hover-text-nowrap">${l} ${100 * g}%</span>`
        : "";
    return (
      '<div class="title">' +
      `<span class="rarity-tier-text">${h}</span> <span class="with-hover-text">(${bb(
        e
      )}${g})</span>` +
      "</div>"
    );
  }
  function db(e, g) {
    const h = le_.t("item_db.affix_card.rarity_on_items"),
      l = le_.t("item_db.affix_card.reroll_chance");
    g =
      null != g
        ? `<span class="hover-text hover-text-nowrap">${l} ${100 * g}%</span>`
        : "";
    return (
      '<div class="title">' +
      `<span class="rarity-tier-text">${h}</span> <span class="with-hover-text">(${bb(
        e
      )}${g})</span>` +
      "</div>"
    );
  }
  function bb(e) {
    switch (e) {
      case "T0":
        return le_.t("item_db.item_card.drop_rarity.extremely_rare");
      case "T1":
        return le_.t("item_db.item_card.drop_rarity.very_rare");
      case "T2":
        return le_.t("item_db.item_card.drop_rarity.rare");
      case "T3":
        return le_.t("item_db.item_card.drop_rarity.uncommon");
      case "T4":
        return le_.t("item_db.item_card.drop_rarity.common");
      default:
        return "Unknown";
    }
  }
  function Ka(e, g) {
    let h = "";
    104 == g
      ? (h = "item-key")
      : 101 == g
      ? (h = "item-crafting item-affix-shard")
      : 102 == g || 103 == g
      ? (h = "item-crafting")
      : 25 <= g && 33 >= g
      ? (h = "item-idol")
      : 34 == g
      ? (h = "item-blessing")
      : 35 <= g && 39 >= g
      ? (h = "item-lens")
      : 105 == g
      ? (h = "item-memory")
      : 106 == g && (h = "item-resonance");
    null != e.affixId && (h = "item-affix");
    return h;
  }
  function wb(e) {
    var g = ba(e.item);
    const h = b.extend(!0, {}, e.item),
      l = [];
    var q = [];
    let t = 0,
      u = 1;
    if (e.gb) {
      var y = La(e.gb, e.ib, e.vg, g, "prefix");
      l.push(y);
      t++;
      u = Math.max(u, e.ib);
      q.push(+e.ib);
    }
    e.qb &&
      ((y = La(e.qb, e.rb, e.wg, g, "prefix")),
      l.push(y),
      t++,
      (u = Math.max(u, e.rb)),
      q.push(+e.rb));
    e.kb &&
      ((y = La(e.kb, e.lb, e.Ag, g, "suffix")),
      l.push(y),
      t++,
      (u = Math.max(u, e.lb)),
      q.push(+e.lb));
    e.ub &&
      ((y = La(e.ub, e.wb, e.Bg, g, "suffix")),
      l.push(y),
      t++,
      (u = Math.max(u, e.wb)),
      q.push(+e.wb));
    e.uc &&
      ((g = La(e.uc, e.vc, e.yg, g, "sealed")),
      l.push(g),
      (u = Math.max(u, e.vc)),
      q.push(+e.vc));
    h.compositeImplicits = h.implicits;
    h.compositeImplicits ||
      ((e = fa(h)), (h.compositeImplicits = b.extend(!0, [], e.implicits)));
    b.each(h.compositeImplicits, function (Q, K) {
      K.canRoll = !0;
    });
    e = T(h);
    g = ua(h) || 1;
    0 < q.length && 7 != e && (g = Math.max(g, Cc(q, u)));
    (q = pa[h.baseTypeId + "-" + h.subTypeId]) &&
      (h.minimumDropLevel = q.minimumDropLevel || 0);
    h.levelRequirement = g;
    h.compositeMods = l;
    let B = !1,
      J = !1;
    b.each(h.compositeMods, function (Q, K) {
      1 == K.specialAffixType ? (B = !0) : 2 == K.specialAffixType && (J = !0);
    });
    h.isExperimental = B;
    h.isPersonal = J;
    h.affixCount = t;
    h.hasExaltedAffix = 5 < u;
    h.compositeRarity =
      7 == e ? (0 < t ? 9 : 7) : J ? 12 : B ? 11 : 5 < u ? 10 : t;
    return h;
  }
  function Cc(e, g) {
    let h = -10;
    e.forEach(function (l) {
      switch (l - 1) {
        case 0:
          h += 1;
          break;
        case 1:
          h += 3;
          break;
        case 2:
          h += 6;
          break;
        case 3:
          h += 10;
          break;
        case 4:
          h += 14;
          break;
        case 5:
          h += 15;
          break;
        case 6:
          h += 16;
          break;
        default:
          h += 16;
      }
    });
    switch (g - 1) {
      case 0:
        h += 2;
        break;
      case 1:
        h += 6;
        break;
      case 2:
        h += 12;
        break;
      case 3:
        h += 20;
        break;
      case 4:
        h += 28;
        break;
      case 5:
        h += 30;
        break;
      case 6:
        h += 32;
        break;
      default:
        h += 32;
      case -1:
    }
    return 1 < h ? h : 1;
  }
  function qb(e) {
    return e != SP.LevelOfSkills;
  }
  function La(e, g, h, l, q) {
    const t = [];
    b.each(e.tiers[g - 1].rolls, function (u) {
      const y = e.affixProperties[u];
      if (y) {
        const J = qb(y.property);
        var B = y.property;
        u = Pb(
          e,
          g - 1,
          u,
          l,
          J,
          !(
            B != SP.LevelOfSkills ||
            B == SP.Strength ||
            B == SP.Vitality ||
            B == SP.Intelligence ||
            B == SP.Dexterity ||
            B == SP.Attunement ||
            B == SP.AllAttributes ||
            B == SP.PotionSlots
          )
        );
        t.push({
          value: u.min,
          maxValue: u.max,
          property: y.property,
          specialTag: y.specialTag,
          tags: y.tags,
          type: y.modifierType,
          hideStatMod: 0,
          canRoll: !0,
          roll: h,
        });
      }
    });
    return {
      mods: t,
      tier: g,
      affixType: q,
      setAffix: e.singleSetAffix,
      affixId: e.id,
      rawAffixId: e.affixId,
      affixTitle: e.affixTitle,
      affixTitleKey: e.affixTitleKey,
      specialAffixType: e.specialAffixType,
    };
  }
  function gb(e) {
    return e
      ? ((e = e.replace(/\//g, "-")), "itemdb-" + e.substr(0, e.length - 4))
      : "";
  }
  function fc(e, g) {
    var h = pa[e.baseTypeId + "-" + g];
    const l = Aa[e.baseTypeId + "-" + g];
    if (!h || !l) return console.log("base item not found", e.id, g), "";
    e = Dc(h, l);
    h = Ec(h, l);
    const q = [];
    b.each(e, function (t, u) {
      u && q.push('<div class="">' + u + "</div>");
    });
    b.each(h, function (t, u) {
      u && q.push('<div class="">' + u + "</div>");
    });
    q.unshift(
      '<div class="base-item-name"><a item-id="' +
        l.id +
        '">' +
        le_d(l) +
        "</a></div>"
    );
    return q.join("");
  }
  function Dc(e, g) {
    const h = [];
    1 == e.isWeapon &&
      h.push(
        '<div style="padding-bottom: 8px">' +
          O(g.addedWeaponRange) +
          U(g.attackRate) +
          "</div>"
      );
    return h;
  }
  function Ec(e, g) {
    const h = [];
    b.each(g.implicits, function (l, q) {
      h.push(L(q));
    });
    return h;
  }
  function Y(e, g, h) {
    e = e[g];
    if (!e) return null;
    for (let l = 0, q; (q = e[l]); l++) if (q.path == h) return q;
    return null;
  }
  function Fc(e, g) {
    const h = [];
    if (!e) return h;
    for (let l = 0, q; (q = e[l]); l++) q.path == g && h.push(q);
    return h;
  }
  function Gc(e) {
    const g = [];
    if (!e) return g;
    for (let h = 0, l; (l = e[h]); h++)
      0 == l.path.indexOf("tiers/") && g.push(l);
    return g;
  }
  function Ma(e, g, h, l) {
    let q = !1,
      t = [];
    for (let y = 0, B; (B = Hc[y]); y++) {
      var u = g[B];
      u &&
        ((u = Fc(u, h)),
        0 != u.length &&
          b.each(u, function (J, Q) {
            J = [];
            null != Q.oldValue && J.push(l("old-value", Q.oldValue));
            null != Q.value && J.push(l("new-value", Q.value));
            0 < J.length &&
              (t.push(
                '<div class="tooltip-skill-params ' +
                  B +
                  " " +
                  (q ? "diff-padding" : "") +
                  '">'
              ),
              (t = t.concat(J)),
              t.push("</div>"),
              (q = !0));
          }));
    }
    0 < t.length && e.push("<div>" + t.join("") + "</div>");
  }
  function Ic(e, g) {
    const h = [];
    let l = 0,
      q = 0;
    const t = e.length + g.length;
    for (let u = 0; u < t; u++) {
      if (l == e.length) {
        for (; q < g.length; q++) h.push({ value: g[q] });
        break;
      }
      if (q == g.length) {
        for (; l < e.length; l++) h.push({ oldValue: e[l] });
        break;
      }
      e[l] == g[q]
        ? (h.push(e[l]), l++, q++)
        : e[l] < g[q]
        ? (h.push({ oldValue: e[l] }), l++)
        : e[l] > g[q] && (h.push({ value: g[q] }), q++);
    }
    return h;
  }
  function gc() {
    b.each(coreDB.propertyList, function (e, g) {
      rb[g.property] = g;
    });
  }
  function Jc() {
    Za = {};
    const e = [];
    (itemDB.oneShotCaches || []).forEach(function (g) {
      0 == g.cacheType &&
        (g.guaranteedItems.forEach(function (h) {
          -1 != h.uniqueID && (Za[h.uniqueID] = g);
        }),
        g.guaranteedSpecificItems.forEach(function (h) {
          const l = hc(h),
            q = ic(l);
          l.Oc = q;
          const t = wb(l);
          t.classRequirement = h.classRequirement || 0;
          t.subClassRequirement = h.subClassRequirement || 0;
          t.personalItemDropInfo = Zb(g);
          t.personalItemId = q;
          12 == T(t) && e.push({ Oc: q, be: l, Kc: t });
        }));
    });
    (itemDB.customPersonalItems || []).forEach(function (g) {
      const h = g.itemProperties,
        l = hc(h),
        q = ic(l);
      l.Oc = q;
      const t = wb(l);
      t.classRequirement = h.classRequirement || 0;
      t.subClassRequirement = h.subClassRequirement || 0;
      t.personalItemDropInfo = vb(g.scene);
      t.personalItemId = q;
      12 == T(t) && e.push({ Oc: q, be: l, Kc: t });
    });
    eb = {};
    Ba = {};
    e.forEach(function (g) {
      const h = g.be,
        l = g.Oc;
      Ba[l] = g.Kc;
      eb[l] = h;
    });
  }
  function Kc() {
    ab = {};
    Object.entries(itemDB.factionGamblerItems || []).forEach(function (e) {
      const [g, h] = e;
      h.forEach(function (l) {
        const [q, t] = l;
        ab[`${q}-${t}`] = g;
      });
    });
  }
  function Lc() {
    $a = {};
    (itemDB.customDrops || []).forEach(function (e) {
      $a[e.itemType + "-" + e.subType] = e.scene;
    });
  }
  function ic(e) {
    const g = [];
    g.push(e.item.baseTypeId);
    g.push(e.item.subTypeId);
    e.gb && g.push(`${e.gb.affixId}/${e.ib}`);
    e.qb && g.push(`${e.qb.affixId}/${e.rb}`);
    e.kb && g.push(`${e.kb.affixId}/${e.lb}`);
    e.ub && g.push(`${e.ub.affixId}/${e.wb}`);
    e.uc && g.push(`${e.uc.affixId}/${e.vc}`);
    return g.join("-");
  }
  function hc(e) {
    const g = itemDB.itemList.equippable[e.itemType].subItems[e.subType];
    e = b.extend(!0, [], e.affixes);
    let [h, l] = Na(e, function (M) {
        return M.sealed;
      }),
      [q, t] = Na(e, function (M) {
        return le_t[le_A[M.id].id];
      }),
      [u, y] = Na(e, function (M) {
        return le_t[le_A[M.id].id];
      }),
      [B, J] = Na(e, function (M) {
        return le_u[le_A[M.id].id];
      }),
      [Q, K] = Na(e, function (M) {
        return le_u[le_A[M.id].id];
      });
    return {
      item: g,
      gb: q,
      qb: u,
      kb: B,
      ub: Q,
      uc: h,
      ib: t,
      rb: y,
      lb: J,
      wb: K,
      vc: l,
    };
  }
  function Na(e, g) {
    g = e.findIndex(g);
    if (-1 != g) {
      const h = e[g],
        l = le_A[h.id];
      if (l) return e.splice(g, 1), [l, h.tier + 1];
    }
    return [null, null];
  }
  function Zb(e) {
    const g = le_.t("item_db.item_card.drop_info.one_shot_cache", {
      name: e.displayName,
    });
    e = vb(e.scene);
    return `<span style="color:#e3d6b5">${g}</span><span class="text-white"> - ${e}</span>`;
  }
  function vb(e) {
    e = itemDB.sceneList[e];
    var g = [];
    var h = e.era;
    (h = null != e.nameKey ? le_b(le_La(h)) : le_Ma(h)) && g.push(h);
    null != e.level &&
      ((h = le_.t("item_db.item_card.drop_info.area_level", {
        value: e.level,
      })),
      g.push(h));
    g = 0 < g.length ? ` (${g.join(", ")})` : "";
    return (null != e.nameKey ? le_b(e.nameKey) : e.name) + g;
  }
  function jc(e) {
    return (e = eb[e]) ? b.extend(!0, {}, e) : null;
  }
  function kc(e) {
    return itemDB.setNames[e];
  }
  function tc(e, g) {
    if (1 == g) {
      g = LEAbilities.allAbilityIdList[e];
      const h = LEAbilities.abilityList[g];
      if (h)
        return le_.t("item_db.item_card.property.level_of_skill", {
          skillName: le_f(h),
        });
      console.error("no ability for id", e, g);
    } else {
      if (e == AT.None && 0 == g)
        return le_.t("item_db.item_card.property.level_of_skills.all");
      const h = [];
      2 <= g && 6 >= g && h.push(zc(g - 2));
      7 <= g && 11 >= g && h.push(Ac(g - 7));
      e = za(e);
      g = e.findIndex(function (l) {
        return l == AT.Minion;
      });
      -1 != g && (h.push("minion"), e.splice(g, 1));
      ma(e, AT.Minion, h, "minion");
      ma(e, AT.Fire, h, "fire");
      ma(e, AT.Cold, h, "cold");
      ma(e, AT.Lightning, h, "lightning");
      ma(e, AT.Poison, h, "poison");
      ma(e, AT.Necrotic, h, "necrotic");
      ma(e, AT.Void, h, "void");
      ma(e, AT.Physical, h, "physical");
      ma(e, AT.Elemental, h, "elemental");
      e.forEach(function (l) {
        h.push(yc(l));
      });
      return le_.t(`item_db.item_card.property.level_of_skills.${h.join(".")}`);
    }
  }
  function sc(e, g) {
    let h = "?";
    if (0 == g) {
      if ((e = aa[e]))
        return le_.t("item_db.item_card.property.drop_rate.equipment_type", {
          itemType: le_d(e),
        });
    } else if (1 == g) 1 == e ? (h = "rune") : 2 == e && (h = "glyph");
    else if (2 == g) {
      if ((e = aa[e]))
        return le_.t(
          "item_db.item_card.property.drop_rate.shard.equipment_type",
          { itemType: le_d(e) }
        );
    } else
      3 == g
        ? 0 == e
          ? (h = "unique")
          : 1 == e && (h = "gold")
        : 4 == g &&
          (0 == e
            ? (h = "shard.prefix")
            : 1 == e
            ? (h = "shard.suffix")
            : 2 == e
            ? (h = "shard.class_specific")
            : 3 == e
            ? (h = "shard.set_affix")
            : 4 == e
            ? (h = "shard.ailment")
            : 5 == e && (h = "shard.skill_level"));
    return le_.t(`item_db.item_card.property.drop_rate.${h}`);
  }
  function vc(e) {
    let g = null,
      h = 0;
    switch (e) {
      case 0:
        g = le_b("Item_Names.Item_Lens_Effect_Boots");
        break;
      case 1:
        g = le_b("Item_Names.Item_Lens_Effect_Belts");
        break;
      case 2:
        g = le_b("Item_Names.Item_Lens_Effect_Helmets");
        break;
      case 3:
        g = le_b("Item_Names.Item_Lens_Effect_Body_Armor");
        break;
      case 4:
        g = le_b("Item_Names.Item_Lens_Effect_Gloves");
        break;
      case 5:
        g = le_b("Item_Names.Item_Lens_Effect_Relics");
        break;
      case 6:
        g = le_b("Item_Names.Item_Lens_Effect_Rings") || "Rings";
        break;
      case 7:
        g = le_b("Item_Names.Item_Lens_Effect_Amulets");
        break;
      case 8:
        g = le_b("Item_Names.Item_Lens_Effect_One_Handed_Swords");
        break;
      case 9:
        g = le_b("Item_Names.Item_Lens_Effect_One_Handed_Axes");
        break;
      case 10:
        g = le_b("Item_Names.Item_Lens_Effect_One_Handed_Maces");
        break;
      case 11:
        g = le_b("Item_Names.Item_Lens_Effect_Daggers");
        break;
      case 12:
        g = le_b("Item_Names.Item_Lens_Effect_Wands");
        break;
      case 13:
        g = le_b("Item_Names.Item_Lens_Effect_Sceptres");
        break;
      case 14:
        g = le_b("Item_Names.Item_Lens_Effect_Two_Handed_Swords");
        break;
      case 15:
        g = le_b("Item_Names.Item_Lens_Effect_Two_Handed_Axes");
        break;
      case 16:
        g = le_b("Item_Names.Item_Lens_Effect_Two_Handed_Maces");
        break;
      case 17:
        g = le_b("Item_Names.Item_Lens_Effect_Staves");
        break;
      case 18:
        g = le_b("Item_Names.Item_Lens_Effect_Spears");
        break;
      case 19:
        g = le_b("Item_Names.Item_Lens_Effect_Bows");
        break;
      case 20:
        g = le_b("Item_Names.Item_Lens_Effect_Quivers");
        break;
      case 21:
        g = le_b("Item_Names.Item_Lens_Effect_Shields");
        break;
      case 22:
        g = le_b("Item_Names.Item_Lens_Effect_Catalysts");
        break;
      case 23:
        g = le_b("Item_Names.Item_Lens_Effect_Affix_Shards");
        break;
      case 24:
        g = le_b("Item_Names.Item_Lens_Effect_Runes");
        break;
      case 25:
        g = le_b("Item_Names.Item_Lens_Effect_Glyphs");
        break;
      case 26:
        g = le_b("Item_Names.Item_Lens_Effect_Keys");
        break;
      case 27:
        g = le_b("Item_Names.Item_Lens_Effect_Small_Idols");
        break;
      case 28:
        g = le_b("Item_Names.Item_Lens_Effect_Humble_Idols");
        break;
      case 29:
        g = le_b("Item_Names.Item_Lens_Effect_Stout_Idols");
        break;
      case 30:
        g = le_b("Item_Names.Item_Lens_Effect_Grand_Idols");
        break;
      case 31:
        g = le_b("Item_Names.Item_Lens_Effect_Large_Idols");
        break;
      case 32:
        g = le_b("Item_Names.Item_Lens_Effect_Ornate_Idols");
        break;
      case 33:
        g = le_b("Item_Names.Item_Lens_Effect_Arena_Events");
        h = 1;
        break;
      case 34:
        g = le_b("Item_Names.Item_Lens_Effect_Monolith_Events");
        h = 1;
        break;
      case 35:
        g = le_b("Item_Names.Item_Lens_Effect_Dungeon_Events");
        h = 1;
        break;
      case 36:
        g = le_b("Item_Names.Item_Lens_Effect_Campaign_Events");
        h = 1;
        break;
      case 37:
        g = le_b("Item_Names.Item_Lens_Effect_High_Corruption_Events");
        h = 1;
        break;
      case 38:
        g = le_b("Item_Names.Item_Lens_Effect_Unique_Items");
        break;
      case 39:
        g = le_b("Item_Names.Item_Lens_Effect_Exalted_Items");
        break;
      case 40:
        g = le_b("Item_Names.Item_Lens_Effect_Set_Items");
        break;
      case 41:
        g = le_b("Item_Names.Item_Lens_Effect_Twice_Uses");
        h = 2;
        break;
      case 42:
        g = le_b("Item_Names.Item_Lens_Effect_Double_Rewards");
        h = 3;
        break;
      case 43:
        g = le_b("Item_Names.Item_Lens_Effect_Huge_Idols");
        break;
      case 44:
        g = le_b("Item_Names.Item_Lens_Effect_Adorned_Idols");
        break;
      case 45:
        g = le_b("Item_Names.Item_Lens_Effect_Lagonian_Small_Idols");
    }
    if (null == g) return console.log("unknown lens item prop"), "";
    switch (h) {
      case 0:
        return le_b(
          "Item_Names.Item_Lens_Effect_Description_Increased_Chance"
        ).replace("{0}", g);
      case 1:
        return le_b("Item_Names.Item_Lens_Effect_Description_Events").replace(
          "{0}",
          g
        );
      case 2:
        return le_b("Item_Names.Item_Lens_Effect_Description_Twice_Uses");
      case 3:
        return le_b("Item_Names.Item_Lens_Effect_Description_Double_Rewards");
    }
  }
  function lc(e) {
    if (null == e.affixTitleKey)
      if (1 == e.titleType)
        switch (e.classSpecificity) {
          case le_C.Primalist:
            e.affixTitle = "Primalist's";
            break;
          case le_C.Mage:
            e.affixTitle = "Mage's";
            break;
          case le_C.Sentinel:
            e.affixTitle = "Sentinel's";
            break;
          case le_C.Acolyte:
            e.affixTitle = "Acolyte's";
            break;
          case le_C.Rogue:
            e.affixTitle = "Rogue's";
        }
      else 1 == e.specialAffixType && (e.affixTitle = "Experimental");
  }
  function Oa(e) {
    return e ? (e.isLegendary ? 9 : e.isSetUnique ? 8 : 7) : 0;
  }
  function xb(e) {
    e =
      1 +
      ra(e.baseTypeId, 3) +
      ra(e.subTypeId, 3) +
      ra(e.rarity, 1) +
      ra(e.uniqueId || 0, 2);
    return "I" + le_$c.Fc(e);
  }
  function mc(e) {
    e = ra(e.subTypeId, 3) + ra(e.uniqueId, 3);
    return "U" + le_$c.Fc(e);
  }
  function nc(e) {
    e = ra(e.affixId, 3);
    return "A" + le_$c.Fc(e);
  }
  function ra(e, g) {
    e = "" + e;
    let h = "";
    for (let l = e.length; l < g; l++) h += "0";
    return h + e;
  }
  let oc = 1;
  const Mc = [5, 6, 7, 8, 9, 10],
    Nc = [12, 13, 14, 15, 16],
    Nb = [0, 1, 2, 3, 4],
    Ob = [20, 21, 22],
    Ta = [25, 26, 27, 28, 29, 30, 31, 32, 33],
    Lb = [35, 36, 37, 38, 39],
    yb = [
      0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 23, 20,
      21, 22,
    ],
    Qa = {
      0: "armor",
      1: "armor",
      2: "armor",
      3: "armor",
      4: "armor",
      5: "weapon",
      6: "weapon",
      7: "weapon",
      8: "weapon",
      9: "weapon",
      10: "weapon",
      11: "weapon",
      12: "weapon",
      13: "weapon",
      14: "weapon",
      15: "weapon",
      16: "weapon",
      17: "weapon",
      18: "weapon",
      19: "weapon",
      23: "weapon",
      24: "weapon",
      20: "accessory",
      21: "accessory",
      22: "accessory",
      25: "idol",
      26: "idol",
      27: "idol",
      28: "idol",
      29: "idol",
      30: "idol",
      31: "idol",
      32: "idol",
      33: "idol",
      35: "lens",
      36: "lens",
      37: "lens",
      38: "lens",
      39: "lens",
      34: "other",
      101: "other",
      102: "other",
      103: "other",
      104: "other",
      105: "other",
      106: "other",
    },
    Oc = {
      0: "item_db.item_card.rarity.basic",
      7: "item_db.item_card.rarity.unique",
      8: "item_db.item_card.rarity.set",
      9: "item_db.item_card.rarity.legendary",
    },
    Pc = "Physical Fire Cold Lightning Necrotic Void Poison".split(" "),
    fb = [
      AT.Physical,
      AT.Fire,
      AT.Cold,
      AT.Lightning,
      AT.Necrotic,
      AT.Void,
      AT.Poison,
    ],
    Qc = ["Melee", "Spell", "Bow", "Throwing", "DoT"],
    pc = [AT.Melee, AT.Spell, AT.Bow, AT.Throwing, AT.DoT],
    Tb = /([A-Z]+)/g,
    Hc = ["deleted", "added", "updated"];
  Array.prototype.diff = function (e) {
    return this.filter(function (g) {
      return 0 > e.indexOf(g);
    });
  };
  Array.prototype.Dd = function (e) {
    const g = this;
    return e.every(function (h) {
      return 0 <= g.indexOf(h);
    });
  };
  Object.re = function (e, g) {
    if (e === g) return !0;
    if (
      !(e instanceof Object && g instanceof Object) ||
      e.constructor !== g.constructor
    )
      return !1;
    for (let h in e)
      if (
        e.hasOwnProperty(h) &&
        (!g.hasOwnProperty(h) ||
          (e[h] !== g[h] &&
            ("object" !== typeof e[h] || !Object.re(e[h], g[h]))))
      )
        return !1;
    for (let h in g) if (g.hasOwnProperty(h) && !e.hasOwnProperty(h)) return !1;
    return !0;
  };
  let jb,
    Xa = {},
    aa = {},
    pa = {},
    Aa = {},
    Da = {},
    Fa = {},
    Ea = {},
    rb = {},
    ob = [],
    Ua = {},
    zb = {},
    Ab = {},
    Bb = {},
    eb = {},
    Ba = {},
    Za = {},
    $a = {},
    ab = {};
  const A = {
    init: function () {
      le_r = {};
      le_s = {};
      le_6c = {};
      le_t = {};
      le_u = {};
      le_hb = {};
      le_7c = {};
      le_8c = {};
      le_A = {};
      Xa = {};
      aa = {};
      pa = {};
      Aa = {};
      Da = {};
      Fa = {};
      Ea = {};
      rb = {};
      ob = [];
      Ua = {};
      zb = {};
      Ab = {};
      Bb = {};
      eb = {};
      Ba = {};
      Za = {};
      $a = {};
      ab = {};
      const e = {};
      b.each(itemDB.itemList.equippable, function (g, h) {
        aa[h.baseTypeId] = h;
        g = le_d(h);
        "idol" == Qa[h.baseTypeId] &&
          (g += " [" + h.size.x + "&times;" + h.size.y + "]");
        Xa[h.baseTypeId] = g;
        e[h.baseTypeId] = !0;
        b.each(h.subItems, function (l, q) {
          const t = h.baseTypeId + "-" + q.subTypeId;
          pa[t] = h;
          Aa[t] = q;
          q.baseTypeId = h.baseTypeId;
          q.rarity = Oa();
          q.id = xb(q);
          le_r[q.id] = q;
          le_8c[q.id] = q;
          b.each(q.uniques, function (u, y) {
            Da[t] = q;
            y.baseTypeId = h.baseTypeId;
            y.subTypeId = q.subTypeId;
            y.rarity = Oa(y);
            y.id = xb(y);
            le_s[y.id] = y;
            zb[h.baseTypeId + "-" + q.subTypeId + "-" + y.uniqueId] = y;
          });
        });
      });
      b.each(itemDB.itemList.nonEquippable, function (g, h) {
        aa[h.baseTypeId] = h;
        Xa[h.baseTypeId] = le_d(h);
        b.each(h.subItems, function (l, q) {
          l = h.baseTypeId + "-" + q.subTypeId;
          pa[l] = h;
          Aa[l] = q;
          q.baseTypeId = h.baseTypeId;
          q.rarity = Oa();
          q.id = xb(q);
          le_r[q.id] = q;
        });
      });
      b.each(itemDB.setBonusList, function (g, h) {
        le_7c[h.setID] = h;
      });
      b.each(itemDB.uniqueList.uniques, function (g, h) {
        h.rarity = h.isLegendary ? 9 : h.isSetItem ? 8 : 7;
        const l = [],
          q = h.subTypeIds.length;
        b.each(h.subTypeIds, function (t, u) {
          t = 1 < q ? b.extend(!0, {}, h) : h;
          t.subTypeId = u;
          t.id = mc(t);
          u = t.baseTypeId + "-" + t.subTypeId;
          var y = Fa[u];
          y || ((y = {}), (Fa[u] = y));
          y[t.id] = t;
          y = Ea[u];
          y || ((y = {}), (Ea[u] = y));
          y[t.id] = t;
          Da[t.id] = Aa[u];
          le_6c[t.id] = t;
          le_r[t.id] = t;
          le_8c[t.id] = t;
          if (1 == t.isSetItem) {
            y = t.setId;
            u = ra(t.setId, 3);
            var B = "S" + le_$c.Fc(u);
            t.rSetId = B;
            u = le_hb[B];
            var J = le_7c[y];
            u ||
              ((u = {
                id: B,
                setId: y,
                displayName: kc(y),
                setMembers: [],
                mods: J.mods,
                tooltipDescriptions: J.tooltipDescriptions,
                tooltipEntries: J.tooltipEntries,
                rarity: 8,
                levelRequirement: 1,
                classRequirement: 0,
                subClassRequirement: 0,
              }),
              (le_hb[B] = u));
            u.setMembers.push(t.id);
            u.levelRequirement = Math.max(u.levelRequirement, ua(t));
            y = 0;
            B = u.setMembers;
            for (let Q = 0, K; (K = B[Q]); Q++)
              if ((J = le_r[K]))
                (J = fa(J)),
                  0 != J.classRequirement && (y = J.classRequirement);
            u.classRequirement = y;
          }
          if (
            (u = zb[t.baseTypeId + "-" + h.oldSubTypeId + "-" + h.oldUniqueId])
          )
            (Ab[u.id] = t.id), (Bb[t.id] = u.id), l.push(u.id);
        });
        b.each(h.legacySubTypeVersions, function (t, u) {
          var y = +t;
          t = b.extend(!0, {}, h);
          t.subTypeId = y;
          t.id = mc(t);
          t.vf = u;
          u = t.baseTypeId + "-" + t.subTypeId;
          if ((y = Aa[u])) {
            let B = Fa[u];
            B || ((B = {}), (Fa[u] = B));
            B[t.id] = t;
            Da[t.id] = y;
            le_s[t.id] = t;
            l.push(t.id);
          } else console.warn("no subtype for base item for unique", h, t.baseTypeId, t.subTypeId);
        });
        h.pg = l;
      });
      Object.keys(le_8c);
      b.each(itemDB.affixList.singleAffixes, function (g, h) {
        le_A[h.affixId] = h;
        h.isSingle = !0;
        h.rarity = Oa();
        h.id = nc(h);
        lc(h);
        0 == h.type
          ? (le_t[h.id] = h)
          : 1 == h.type
          ? (le_u[h.id] = h)
          : console.error("unknown affix type");
      });
      b.each(itemDB.affixList.multiAffixes, function (g, h) {
        le_A[h.affixId] = h;
        h.isSingle = !1;
        h.rarity = Oa();
        h.id = nc(h);
        lc(h);
        0 == h.type
          ? (le_t[h.id] = h)
          : 1 == h.type
          ? (le_u[h.id] = h)
          : console.error("unknown affix type");
      });
      b.each(itemDB.itemList.disabledBaseTypesToRoll, function (g, h) {
        Ua[h] = !0;
      });
      b.each(e, function (g) {
        ob.push(g);
      });
      Jc();
      Kc();
      Lc();
      jb = new le_ad();
      gc();
    },
  };
  A.kg = gc;
  A.getCategoryText = Ga;
  A.getItemClass = ba;
  A.Xf = function (e) {
    e = ba(e);
    return yb.includes(e)
      ? "ItemGroupEquipment"
      : Ta.includes(e)
      ? "ItemGroupIdol"
      : Lb.includes(e)
      ? "ItemGroupLenses"
      : e;
  };
  A.getItemName = Ca;
  A.getItemGridSize = Ub;
  A.fg = Ya;
  A.getItemRarity = T;
  A.getItemIdAttr = ub;
  A.getItemRarityTextStandalone = function (e) {
    e = T(e);
    return le_.t(Oc[e]) || "";
  };
  A.getLevelRequirement = ua;
  A.fixImageUrl = gb;
  A.formatItemNameLink = oa;
  A.formatItemNameExternalLink = Ja;
  A.formatItemBitmap = function (e, g) {
    if (!e) return "";
    g = g || {};
    const h = T(e);
    let l = "";
    g.addAlpha && (l += " with-alpha");
    let q = "";
    g.addReqNotMetOverlay && (q += '<div class="req-not-met-overlay"></div>');
    g = "";
    le_s[e.id] && (g += " legacy");
    return (
      '<div class="item-bitmap-background bg-rarity' +
      h +
      g +
      '"></div>' +
      q +
      '<div class="item-bitmap itemdb ' +
      gb(e.sprite + ".png") +
      l +
      '"></div>'
    );
  };
  A.Ef = c;
  A.formatItemCard = function (e, g, h, l) {
    const q = [];
    if (!e) return q;
    const t = d(e);
    g = k(e, g, h);
    h = [];
    var u = w(e);
    if (u.Pa) {
      var y = u.Pa;
      u = u.ok
        ? '<span class="help-btn with-hover-text"><svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M480-240q20 0 34-14t14-34q0-20-14-34t-34-14q-20 0-34 14t-14 34q0 20 14 34t34 14Zm-36-153h73q0-37 6.5-52.5T555-485q35-34 48.5-58t13.5-53q0-55-37.5-89.5T484-720q-51 0-88.5 27T343-620l65 27q9-28 28.5-43.5T482-652q28 0 46 16t18 42q0 23-15.5 41T496-518q-35 32-43.5 52.5T444-393Zm36 297q-79 0-149-30t-122.5-82.5Q156-261 126-331T96-480q0-80 30-149.5t82.5-122Q261-804 331-834t149-30q80 0 149.5 30t122 82.5Q804-699 834-629.5T864-480q0 79-30 149t-82.5 122.5Q699-156 629.5-126T480-96Z"></path></svg>' +
          `<span class="hover-text">${
            le_.t("item_db.item_card.lp_tooltip_line_1") +
            "<div class='text-divider'></div>" +
            le_.t("item_db.item_card.lp_tooltip_line_2", {}, "text-highlight") +
            "<div class='text-divider'></div>" +
            le_.t("item_db.item_card.lp_tooltip_line_4", {}, "text-highlight")
          }</span>` +
          "</span>"
        : "";
      h.push(
        '<div class="legendary-potential item-padded-v">' + y + u + "</div>"
      );
    }
    (y = Vb(e)) &&
      h.push('<div class="dropped-from item-padded-v" >' + y + "</div>");
    (u = Wb(e)) &&
      h.push('<div class="dropped-from item-padded-v" >' + u + "</div>");
    var B = Xb(e);
    B && h.push('<div class="dropped-from item-padded-v" >' + B + "</div>");
    const J = Yb(e);
    J && h.push('<div class="dropped-from item-padded-v" >' + J + "</div>");
    const Q = $b(e);
    Q && h.push('<div class="dropped-from item-padded-v" >' + Q + "</div>");
    const K = bc(e);
    K && h.push('<div class="dropped-from item-padded-v" >' + K + "</div>");
    var M = !1;
    if (
      !(
        34 == e.baseTypeId ||
        (35 <= e.baseTypeId && 39 >= e.baseTypeId) ||
        u ||
        B ||
        J ||
        Q ||
        K
      )
    ) {
      const P = x(e.cannotDrop);
      P &&
        ((M = !0),
        h.push('<div class="dropped-from item-padded-v">' + P + "</div>"));
    }
    l &&
      0 == T(e) &&
      (l = Bc(e, M)) &&
      h.push('<div class="dropped-from item-padded-v">' + l + "</div>");
    (l = cc(e)) &&
      h.push('<div class="dropped-from item-padded-v">' + l + "</div>");
    (M = ec(e)) &&
      h.push('<div class="dropped-from item-padded-v">' + M + "</div>");
    y ||
      u ||
      B ||
      J ||
      Q ||
      K ||
      !e.unknownDrop ||
      h.push(
        '<div class="dropped-from item-padded-v"><span class="title">' +
          le_.t("item_db.item_card.drop_info.obtained_from") +
          "</span>?</div>"
      );
    (B = I(e)) &&
      h.push('<div class="target-farm item-padded-v">' + B + "</div>");
    B = e.rarityTier;
    null != e.affixId
      ? (1 == e.specialAffixType
          ? h.push(
              '<div class="title">' +
                le_.t(
                  "item_db.affix_card.exclusive_to_exiled_mage",
                  {},
                  "rarity-tier-text"
                ) +
                "</div>"
            )
          : 2 == e.specialAffixType &&
            h.push(
              '<div class="title">' +
                le_.t(
                  "item_db.affix_card.exclusive_to_personal_items",
                  {},
                  "rarity-tier-text"
                ) +
                "</div>"
            ),
        h.push(
          '<div class="rarity_tier item-padded-v">' +
            db(B, e.rerollChance) +
            "</div>"
        ))
      : (null != l && !e.notTimelineExclusive) ||
        M ||
        y ||
        u ||
        e.unknownDrop ||
        !B ||
        h.push(
          '<div class="rarity_tier item-padded-v">' +
            cb(B, e.rerollChance) +
            "</div>"
        );
    h = h.join("");
    q.push(
      '<div class="top-middle-block"><div class="top-block">' +
        t +
        '</div><div class="middle-block">' +
        g +
        "</div></div>" +
        (h ? '<div class="bottom-block">' + h + "</div>" : "")
    );
    le_s[e.id] &&
      q.push(
        '<div class="badge-legacy">' +
          le_.t("item_db.item_card.legacy_item") +
          "</div>"
      );
    return q.join("");
  };
  A.formatItemSetStandalone = function (e) {
    let g = [];
    g.push('<div class="item-description">');
    g.push(
      '<div><a class="item-set-name rarity8" item-set-id="' +
        e.id +
        '">' +
        e.displayName +
        "</a></div>"
    );
    g.push('<div class="tooltip-skill-params item-padded-v">');
    g = g.concat(Fb(e));
    g.push("</div>");
    const h = n([e.id]);
    0 < h.length && (g = g.concat(h));
    e = ib(e);
    0 < e.length && (g = g.concat(e));
    g.push("</div>");
    return '<div class="top-middle-block">' + g.join("") + "</div>";
  };
  A.cleanup = function () {};
  A.setAttributeType = function (e) {
    oc = e;
  };
  A.getAttributeType = function () {
    return oc;
  };
  A.getItemGroupTypes = function (e) {
    const g = [];
    b.each(Qa, function (h, l) {
      l == e && g.push(h);
    });
    return g;
  };
  A.formatItemDiff = function (e, g) {
    const h = [];
    if (le_t[e.id] || le_u[e.id]) {
      var l = Y(g, "updated", "type");
      l &&
        h.push(
          '<div><div class="deleted"><div>' +
            Qb(l.oldValue) +
            '</div></div><div class="added diff-padding"><div>' +
            Qb(l.value) +
            "</div></div></div>"
        );
    }
    (l = Y(g, "updated", "displayName")) &&
      h.push(
        '<div><div class="deleted"><div>' +
          l.oldValue +
          '</div></div><div class="added diff-padding"><div>' +
          l.value +
          "</div></div></div>"
      );
    (l = Y(g, "updated", "affixDisplayName")) &&
      h.push(
        '<div><div class="deleted"><div>' +
          (l.oldValue || "-") +
          '</div></div><div class="added diff-padding"><div>' +
          (l.value || "-") +
          "</div></div></div>"
      );
    (l = Y(g, "updated", "itemText")) &&
      h.push(
        '<div><div class="deleted"><div>' +
          l.oldValue +
          '</div></div><div class="added diff-padding"><div>' +
          l.value +
          "</div></div></div>"
      );
    (l = Y(g, "updated", "description")) &&
      h.push(
        '<div><div class="deleted">' +
          v(l.oldValue) +
          '</div><div class="added diff-padding">' +
          v(l.value) +
          "</div></div>"
      );
    (l = Y(g, "updated", "subTypeIds")) &&
      h.push(
        '<div><div style="margin-bottom: 8px;">' +
          le_.t("item_db.diffs.base_item_changed") +
          '</div><div class="old-value diff-subtype-change">' +
          fc(e, l.oldValue) +
          '</div><div class="new-value diff-subtype-change" style="margin-top:8px">' +
          fc(e, l.value) +
          "</div></div>"
      );
    l = pa[e.baseTypeId + "-" + e.subTypeId];
    fa(e);
    l &&
      1 == l.isWeapon &&
      ((l = Y(g, "updated", "addedWeaponRange")) &&
        h.push("<div>" + O(l) + "</div>"),
      (l = Y(g, "updated", "attackRate")) && h.push("<div>" + U(l) + "</div>"));
    Ma(h, g, "implicits", function (u, y) {
      return '<div class="' + u + ' item-mod-unique">' + L(y) + "</div>";
    });
    Ma(h, g, "basicMods", function (u, y) {
      return '<div class="' + u + ' item-mod-unique">' + S(y) + "</div>";
    });
    Ma(h, g, "descriptionParts", function (u, y) {
      return '<div class="' + u + ' item-mod-unique">' + sa(y) + "</div>";
    });
    Ma(h, g, "mods", function (u, y) {
      return 1 == y.hideInTooltip
        ? null
        : '<div class="' + u + ' item-mod-unique">' + na(y) + "</div>";
    });
    Ma(h, g, "tooltipDescriptions", function (u, y) {
      return '<div class="' + u + ' item-mod-unique">' + ta(e, y) + "</div>";
    });
    Y(g, "updated", "standardAffixEffectModifier") &&
      h.push(
        '<div><span class="updated-value">' +
          le_.t("item_db.diffs.scaling_modifier_changed") +
          "</span></div>"
      );
    (l = Y(g, "updated", "affixTitle")) && h.push("<div>" + Cb(l) + "</div>");
    l = Gc(g.updated);
    if (0 < l.length) {
      const u = b.extend(!0, [], e.tiers);
      b.each(l, function (y, B) {
        y = B.path.split("/");
        u[y[1]].rolls[y[3]] = { oldValue: B.oldValue, value: B.value };
      });
      h.push(Eb(e, u));
    }
    if ((l = Y(g, "updated", "canRollOn")))
      (l = Ic(l.oldValue, l.value)), h.push("<div>" + hb(l) + "</div>");
    (l = Y(g, "updated", "loreText")) &&
      h.push(
        '<div><div class="deleted">' +
          (v(l.oldValue) || "-") +
          '</div><div class="added diff-padding">' +
          (v(l.value) || "-") +
          "</div></div>"
      );
    var q = Y(g, "updated", "levelRequirement");
    q &&
      ((l = ua(e, q.oldValue)),
      (q = ua(e, q.value)),
      h.push("<div>" + Ib({ oldValue: l, value: q }) + "</div>"));
    if ((q = Y(g, "updated", "classRequirement")))
      (l = Ra(e, q.oldValue)),
        (q = Ra(e, q.value)),
        h.push("<div>" + Jb({ oldValue: l, value: q }) + "</div>");
    if ((q = Y(g, "updated", "classSpecificity")))
      (l = Sa(e, q.oldValue)),
        (q = Sa(e, q.value)),
        h.push("<div>" + Kb({ oldValue: l, value: q }) + "</div>");
    q = Y(g, "updated", "effectiveLevelForLegendaryPotential");
    const t = Y(g, "updated", "overrideEffectiveLevelForLegendaryPotential");
    if (q || t)
      (l = w(
        e,
        q ? q.oldValue : e.effectiveLevelForLegendaryPotential,
        t ? t.oldValue : e.overrideEffectiveLevelForLegendaryPotential
      ).Pa),
        (q = w(
          e,
          q ? q.value : e.effectiveLevelForLegendaryPotential,
          t ? t.value : e.overrideEffectiveLevelForLegendaryPotential
        ).Pa),
        h.push(
          '<div class="legendary-potential"><div class="deleted">' +
            l +
            '</div><div class="added diff-padding">' +
            q +
            "</div></div>"
        );
    (l = Y(g, "updated", "cannotDrop")) &&
      h.push("<div>" + x({ oldValue: l.oldValue, value: l.value }) + "</div>");
    (l = Y(g, "updated", "rarityTier")) &&
      (null != e.affixId
        ? h.push(
            '<div><div class="deleted">' +
              db(l.oldValue) +
              '</div><div class="added diff-padding">' +
              db(l.value) +
              "</div></div>"
          )
        : h.push(
            '<div><div class="deleted">' +
              cb(l.oldValue) +
              '</div><div class="added diff-padding">' +
              cb(l.value) +
              "</div></div>"
          ));
    (l = Y(g, "updated", "unknownDrop")) &&
      h.push(
        '<div class="' +
          (l.oldValue ? "deleted" : "added") +
          '"><div>' +
          le_.t("item_db.item_card.drop_info.cant_drop_randomly") +
          "</div></div>"
      );
    0 == h.length && console.error("no diff", e.id, g);
    return h.join('<div class="diff-divider">&nbsp;</div>');
  };
  A.yf = Y;
  A.getCategoriesWithText = function (e) {
    const g = [];
    if (e) {
      const l = [];
      for (var h = 0; h < e.length; h++) Ua[e[h]] || l.push(e[h]);
      for (e = 0; e < l.length; e++) (h = l[e]), g.push({ id: h, text: Ga(h) });
    }
    return g;
  };
  A.formatAffixTiersForList = function (e, g, h) {
    let l = [];
    l.push('<div class="tooltip-skill-params tier-table alt">');
    let q = "";
    b.each(g, function (y) {
      y = le_.t("item_db.affix_card.affix_tier", { num: y + 1 });
      q += '<div class="affix-tier-range">' + y + "</div>";
    });
    const t = [];
    t.push(
      '<div class="affix tier-header"><div class="affix-tier-name"></div>' +
        q +
        "</div>"
    );
    const u = null == h ? null : aa[h].affixEffectModifier;
    b.each(e.affixProperties, function (y, B) {
      let J = Ha(e, B);
      J && (J += "<br>");
      J += '<span class="mod-type">' + pb(B.modifierType) + "</span>";
      let Q = "";
      b.each(g, function (K, M) {
        var P = M.rolls[y];
        if ((K = qa(B.property, B.tags, B.specialTag))) {
          const W = qb(B.property);
          if (null != P.oldValue) {
            const ea = ca(e, P.oldValue.min, u, y, W),
              ha = ca(e, P.oldValue.max, u, y, W),
              ya = ca(e, P.value.min, u, y, W);
            P = ca(e, P.value.max, u, y, W);
            Q +=
              '<div class="affix-tier-range"><span class="old-value">' +
              xa(K, B.modifierType, ea, ha, !1, !1, !0) +
              "</span>" +
              (1 < M.rolls.length ? "<br/>" : "") +
              '<span class="new-value">' +
              xa(K, B.modifierType, ya, P, !1, !1, !0) +
              "</span></div>";
          } else
            (M = ca(e, P.min, u, y, W)),
              (P = ca(e, P.max, u, y, W)),
              (Q +=
                '<div class="affix-tier-range">' +
                xa(K, B.modifierType, M, P, !1, !1, !0) +
                "</div>");
        }
      });
      t.push(
        '<div class="affix"><div class="affix-tier-name">' +
          J +
          "</div>" +
          Q +
          "</div>"
      );
    });
    l = l.concat(t.join(""));
    l.push("</div>");
    return l.join("");
  };
  A.getItemTypeForPageTitle = function (e) {
    var g = aa[e.baseTypeId];
    let h = "";
    g && (h = le_d(g));
    if (null != e.uniqueId) {
      g = fa(e);
      if (null == g) return console.error("base not found for item", e), h;
      let l = null;
      switch (T(e)) {
        case 7:
          l = "item_db.item_card.unique_item_name";
          break;
        case 8:
          l = "item_db.item_card.set_item_name";
          break;
        case 9:
          l = "item_db.item_card.legendary_item_name";
      }
      l &&
        ((e = le_
          .t(l, { itemName: le_d(g) })
          .replace(/<a>([^<]+)<\/a>/i, "$1")),
        (h += " - " + e));
    }
    return h;
  };
  A.$f = function (e) {
    return Bb[e];
  };
  A.bg = function (e) {
    return Ab[e];
  };
  A.fd = function () {
    const e = [];
    b.each(le_A, function (g, h) {
      if ((g = 0 < h.canRollOn.length))
        (g = h.classSpecificity || 0),
          (g =
            0 != g
              ? g & le_C.Primalist
                ? !0
                : g & le_C.Mage
                ? !0
                : g & le_C.Sentinel
                ? !0
                : g & le_C.Acolyte
                ? !0
                : g & le_C.Rogue
                ? !0
                : !1
              : !1);
      g && !nb(h.canRollOn) && e.push(h.affixId);
    });
    return e;
  };
  A.Bf = function (e) {
    const g = Ja(e);
    var h = ba(e);
    null == h && (h = "");
    h = Ka(e, h);
    const l = Ya(e),
      q = T(e) || 0;
    let t = "",
      u = "";
    e.sprite
      ? (t = `<span class="item-icon-inline rarity${q}">
			<span class="centered">
				${`<span class="itemdb itemdb-${e.sprite}"></span>`}
			</span>
		</span>`)
      : (u = " no-icon");
    h && (u += " " + h);
    l && (u += " " + `grid-${l.x}x${l.y}`);
    return `<span class="item-icon-name ${u}">
		${t}
		${g}
	</span>`.replace(/[\t\n]/g, "");
  };
  A.Af = function (e) {
    const g = Ja(e);
    var h = ba(e);
    null == h && (h = "");
    h = Ka(e, h);
    const l = Ya(e);
    T(e);
    let q = "",
      t = "no-icon";
    e.affixId &&
      (q = `<span class="affix-label-inline">${
        le_t[e.id]
          ? le_.t("item_db.item_card.type.prefix")
          : le_.t("item_db.item_card.type.suffix")
      }</span>`);
    h && (t += " " + h);
    l && (t += " " + `grid-${l.x}x${l.y}`);
    return `<span class="item-icon-name ${t}">
		${q}
		${g}
	</span>`.replace(/[\t\n]/g, "");
  };
  A.Cf = function (e) {
    return "<span>" + Ja(e) + "</span>";
  };
  A.Df = function (e) {
    const g = Ca(e);
    var h = ba(e);
    null == h && (h = "");
    h = Ka(e, h);
    const l = Ya(e),
      q = T(e) || 0;
    let t = "",
      u = "";
    e.sprite
      ? (t = `<span class="item-icon-inline rarity${q}">
			<span class="centered">
				${`<span class="itemdb itemdb-${e.sprite}"></span>`}
			</span>
		</span>`)
      : (u = " no-icon");
    h && (u += " " + h);
    l && (u += " " + `grid-${l.x}x${l.y}`);
    const y = [],
      B = ["c_prefix1", "c_prefix2"],
      J = ["c_suffix1", "c_suffix2"],
      Q = ["c_sealed_affix"];
    b.each(e.compositeMods, function (K, M) {
      K = M.affixId + "," + (M.tier || 1);
      let P = null;
      "prefix" == M.affixType
        ? (P = B.shift())
        : "suffix" == M.affixType
        ? (P = J.shift())
        : "sealed" == M.affixType && (P = Q.shift());
      null != P && y.push(`${P}="${K}"`);
    });
    return `<span class="item-icon-name ${u}">
		${t}
		${`<a href="${`${le_c("/db/")}/items/${
      e.id
    }`}" class="item-link rarity${q}" c_item_id="${e.id}" ${y.join(" ")}>
		${g}
	</a>`}
	</span>`.replace(/[\t\n]/g, "");
  };
  A.ATTRIBUTE_AVERAGE = 1;
  A.ATTRIBUTE_MIN_MAX = 2;
  A.getTaggedPropertyString = va;
  A.getProperty = qa;
  A.formatMod = Pa;
  A.getTextForAT = Wa;
  A.getEnumerableTags = za;
  A.formatBuff = function (e, g) {
    const h = e.property,
      l = e.tags,
      q = e.specialTag,
      t = va(h, l, q),
      u = [];
    0 != e.addedValue && u.push(da(t, h, 0, e.addedValue, null, l, q, g, !0));
    0 != e.increasedValue &&
      u.push(da(t, h, 1, e.increasedValue, null, l, q, g, !0));
    0 < e.moreValues.length &&
      b.each(e.moreValues, function (y, B) {
        u.push(da(t, h, 2, B, null, l, q, g, !0));
      });
    return u;
  };
  A.getAffixValues = Pb;
  A.affixClassReqMet = function (e, g, h) {
    g = g.classSpecificity || 0;
    const l = e ? fa(e) : null;
    if (l && 0 == l.classRequirement)
      if (null != e.uniqueId) {
        if (g & le_C.NonSpecific) return !0;
      } else return 0 == g || g & le_C.NonSpecific;
    return 0 != g
      ? 0 == h && g & le_C.Primalist
        ? !0
        : 1 == h && g & le_C.Mage
        ? !0
        : 2 == h && g & le_C.Sentinel
        ? !0
        : 3 == h && g & le_C.Acolyte
        ? !0
        : 4 == h && g & le_C.Rogue
        ? !0
        : !1
      : !0;
  };
  A.itemClassReqMet = function (e, g) {
    e = fa(e).classRequirement || 0;
    return 0 != e
      ? 0 == g && e & le_B.Primalist
        ? !0
        : 1 == g && e & le_B.Mage
        ? !0
        : 2 == g && e & le_B.Sentinel
        ? !0
        : 3 == g && e & le_B.Acolyte
        ? !0
        : 4 == g && e & le_B.Rogue
        ? !0
        : !1
      : !0;
  };
  A.is2hItem = function (e) {
    return e && -1 != Nc.indexOf(ba(e));
  };
  A.is1hItem = function (e) {
    return e && -1 != Mc.indexOf(ba(e));
  };
  A.isQuiver = function (e) {
    return e && 17 == ba(e);
  };
  A.isBow = function (e) {
    return e && 23 == ba(e);
  };
  A.isIdol = Gb;
  A.lg = function (e) {
    return e && -1 != yb.indexOf(ba(e));
  };
  A.getIdolSize = function (e) {
    e = aa[e.baseTypeId];
    return { x: e.size.x, y: e.size.y };
  };
  A.formatUniqueBasicMod = S;
  A.getItemType = function (e) {
    let g = "";
    if (le_t[e.id]) return le_.t("item_db.item_card.type.prefix");
    if (le_u[e.id]) return le_.t("item_db.item_card.type.suffix");
    if (le_hb[e.id]) return le_.t("item_db.item_card.type.item_set");
    (e = aa[e.baseTypeId]) && (g = le_d(e));
    return g;
  };
  A.getBaseItem = fa;
  A.gg = kc;
  A.getItemById = function (e) {
    return le_r[e] || le_s[e];
  };
  A.Gf = function (e) {
    const g = [],
      h = Vb(e);
    h && g.push('<div class="dropped-from item-padded-v" >' + h + "</div>");
    const l = Wb(e);
    l && g.push('<div class="dropped-from item-padded-v" >' + l + "</div>");
    var q = Xb(e);
    q && g.push('<div class="dropped-from item-padded-v" >' + q + "</div>");
    const t = Yb(e);
    t && g.push('<div class="dropped-from item-padded-v" >' + t + "</div>");
    const u = $b(e);
    u && g.push('<div class="dropped-from item-padded-v" >' + u + "</div>");
    const y = bc(e);
    y && g.push('<div class="dropped-from item-padded-v" >' + y + "</div>");
    const B = cc(e);
    B && g.push('<div class="dropped-from item-padded-v">' + B + "</div>");
    const J = ec(e);
    J && g.push('<div class="dropped-from item-padded-v">' + J + "</div>");
    h ||
      l ||
      q ||
      t ||
      u ||
      y ||
      !e.unknownDrop ||
      g.push(
        '<div class="dropped-from item-padded-v"><span class="title">' +
          le_.t("item_db.item_card.drop_info.obtained_from") +
          "</span>?</div>"
      );
    (q = I(e)) &&
      g.push('<div class="item-padded-v target-farm">' + q + "</div>");
    q = e.rarityTier;
    null != e.affixId
      ? g.push(
          '<div class="rarity_tier item-padded-v">' +
            db(q, e.rerollChance) +
            "</div>"
        )
      : (null != B && !e.notTimelineExclusive) ||
        J ||
        h ||
        l ||
        e.unknownDrop ||
        !q ||
        g.push(
          '<div class="rarity_tier item-padded-v">' +
            cb(q, e.rerollChance) +
            "</div>"
        );
    return g.join("");
  };
  A.Hf = Db;
  A.Ff = ib;
  A.Nb = ka;
  A.Qf = Ra;
  A.Rf = Sa;
  A.ag = r;
  A.Yf = mb;
  A.jf = z;
  A.pc = bb;
  A.Be = nb;
  A.bd = pb;
  A.cd = function (e) {
    const g = nb(e.canRollOn);
    e = le_t[e.id];
    return g
      ? e
        ? le_.t("loot_filters.affix_type.idol_prefix")
        : le_.t("loot_filters.affix_type.idol_suffix")
      : e
      ? le_.t("loot_filters.affix_type.equipment_prefix")
      : le_.t("loot_filters.affix_type.equipment_suffix");
  };
  A.ug = function (e) {
    if ((e = le_$c.qe(e.substr(1))))
      return { zg: +e.substr(0, 3), Cg: +e.substr(3) };
  };
  A.Kf = p;
  A.Jf = m;
  A.mg = N;
  A.ng = C;
  A.og = G;
  A.nf = {
    0: 1,
    1: 2,
    4: 3,
    2: 4,
    3: 5,
    9: 11,
    5: 10,
    7: 12,
    6: 13,
    8: 14,
    10: 15,
    11: 16,
    16: 20,
    12: 17,
    13: 18,
    14: 19,
    15: 21,
    23: 22,
    24: 23,
    17: 24,
    18: 25,
    19: 26,
    21: 30,
    20: 31,
    22: 32,
    25: 40,
    26: 41,
    27: 42,
    28: 43,
    29: 44,
    30: 45,
    31: 46,
    32: 47,
    33: 48,
    35: 50,
    36: 51,
    37: 52,
    38: 53,
    39: 54,
    34: 63,
    102: 60,
    103: 61,
    101: 62,
    104: 65,
    105: 64,
    106: 65,
  };
  A.lf = {
    ItemGroupEquipment: 1,
    ItemGroupIdol: 2,
    ItemGroupLenses: 3,
    34: 53,
    102: 50,
    103: 51,
    101: 52,
    104: 55,
    105: 54,
    106: 55,
  };
  A.mf = Qa;
  A.kf = {
    helms: 0,
    chest: 1,
    gloves: 4,
    belts: 2,
    boots: 3,
    axes: 5,
    swords: 9,
    maces: 7,
    daggers: 6,
    scepters: 8,
    wands: 10,
    unarmed: 11,
    swords2h: 16,
    axes2h: 12,
    maces2h: 13,
    polearms2h: 14,
    staves: 15,
    bows: 23,
    crossbows: 24,
    quivers: 17,
    shields: 18,
    foci: 19,
    rings: 21,
    amulets: 20,
    relics: 22,
    idols11: 25,
    idols11_2: 26,
    idols21: 27,
    idols12: 28,
    idols31: 29,
    idols13: 30,
    idols41: 31,
    idols14: 32,
    idols22: 33,
    greater_lens: 35,
    arctus_lens: 36,
    mesembria_lens: 37,
    eos_lens: 38,
    dysis_lens: 39,
    blessings: 34,
    runes: 102,
    glyphs: 103,
    shards: 101,
    keys: 104,
    memories: 105,
    resonances: 106,
  };
  A.ab = Ta;
  A.lc = yb;
  A.oc = function (e) {
    const g = e.id,
      h = T(e);
    let l = ba(e);
    null == l && (l = "");
    let q = "item-" + Ub(e);
    q += ` item-rarity${h}`;
    itemDB.minGridSize2x2 && (q += " min-grid-22");
    (e = Ka(e, l)) && (q += " " + e);
    le_s[g] && (q += " item-legacy");
    return q;
  };
  A.Zf = Ka;
  A.Dc = wb;
  A.ig = function (e) {
    return Fa[e];
  };
  A.hg = function (e, g) {
    return Aa[e + "-" + g];
  };
  A.te = E;
  A.Ee = function (e) {
    const g = Ea[e.baseTypeId + "-" + e.subTypeId];
    e =
      34 != e.baseTypeId &&
      !(35 <= e.baseTypeId && 39 >= e.baseTypeId) &&
      e.cannotDrop;
    return g && 0 < Object.keys(g).length && e;
  };
  A.ue = function (e) {
    if (
      (e = Ea[e.baseTypeId + "-" + e.subTypeId]) &&
      0 < Object.keys(e).length
    ) {
      const g = [];
      b.each(e, function (l, q) {
        g.push(q);
      });
      g.sort(function (l, q) {
        const t = T(l),
          u = T(q);
        if (t != u) return t - u;
        l = le_d(l).toLowerCase();
        q = le_d(q).toLowerCase();
        return l.localeCompare(q);
      });
      const h = [];
      b.each(g, function (l, q) {
        h.push(Ja(q, !0));
      });
      return h.join(", ");
    }
    return "";
  };
  A.ad = Ha;
  A.eg = function () {
    return Object.values(Ba);
  };
  A.cg = function (e) {
    return Ba[e];
  };
  A.dg = jc;
  A.zf = function (e, g, h) {
    let l = null;
    Object.entries(Ba).forEach(function (q) {
      const [t, u] = q;
      u.baseTypeId == e &&
        u.subTypeId == g &&
        u.compositeMods.forEach(function (y) {
          y.affixId == h && (l = t);
        });
    });
    return null != l ? jc(l) : null;
  };
  A.rg = function (e, g) {
    if ((g = Ba[g]))
      (e.classRequirement = g.classRequirement),
        (e.subClassRequirement = g.subClassRequirement),
        (e.personalItemDropInfo = g.personalItemDropInfo),
        (e.personalItemId = g.personalItemId);
  };
  A.gd = Rb;
  A.Nd = sb;
  A.Tf = function (e) {
    const g = fb.findIndex(function (h) {
      return h == e;
    });
    return sb(g);
  };
  A.Sf = function () {
    const e = [];
    fb.forEach(function (g, h) {
      e.push([g, Rb(h)]);
    });
    return e;
  };
  A.Uf = function () {
    return Pc;
  };
  A.Vf = function () {
    return fb;
  };
  A.jg = function (e) {
    let g = !0;
    fb.forEach(function (h) {
      (h & e) == h && (g = !1);
    });
    return !g;
  };
  A.Mf = Sb;
  A.Ld = function (e) {
    switch (e) {
      case 0:
        return le_.t("planner.attack_types.melee");
      case 1:
        return le_.t("planner.attack_types.spell");
      case 2:
        return le_.t("planner.attack_types.bow");
      case 3:
        return le_.t("planner.attack_types.throwing");
      case 4:
        return le_.t("planner.attack_types.damage_over_time");
      default:
        return "";
    }
  };
  A.Nf = function () {
    const e = [];
    pc.forEach(function (g, h) {
      e.push([g, Sb(h)]);
    });
    return e;
  };
  A.Of = function () {
    return Qc;
  };
  A.Pf = function () {
    return pc;
  };
  A.hd = Ia;
  A.Sd = function (e) {
    return null != ac(e);
  };
  A.Wf = function (e) {
    switch (e) {
      case 0:
        return "#4a3672";
      case 1:
        return "#74412a";
      default:
        return "";
    }
  };
  a.$db = A;
})(window, $);
const le_C = {
    None: 0,
    NonSpecific: 1,
    Primalist: 2,
    Mage: 4,
    Sentinel: 8,
    Acolyte: 16,
    Rogue: 32,
  },
  le_B = { None: 0, Primalist: 1, Mage: 2, Sentinel: 4, Acolyte: 8, Rogue: 16 },
  le_9c = {
    None: 0,
    BM_Sorc_VK_Necro_BD: 1,
    Sha_SB_FG_Lich_Mark: 2,
    Dru_RM_Pal_Warl_Falc: 3,
  };
var le_$c = (function () {
  function a(f, k) {
    if (!c[f]) {
      c[f] = {};
      for (var n = 0; n < f.length; n++) c[f][f.charAt(n)] = n;
    }
    return c[f][k];
  }
  var b = String.fromCharCode,
    c = {},
    d = {
      pf: function (f) {
        if (null == f) return "";
        f = d.xc(f, 6, function (k) {
          return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(
            k
          );
        });
        switch (f.length % 4) {
          default:
          case 0:
            return f;
          case 1:
            return f + "===";
          case 2:
            return f + "==";
          case 3:
            return f + "=";
        }
      },
      sf: function (f) {
        return null == f
          ? ""
          : "" == f
          ? null
          : d.yc(f.length, 32, function (k) {
              return a(
                "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
                f.charAt(k)
              );
            });
      },
      qf: function (f) {
        return null == f
          ? ""
          : d.xc(f, 15, function (k) {
              return b(k + 32);
            }) + " ";
      },
      tf: function (f) {
        return null == f
          ? ""
          : "" == f
          ? null
          : d.yc(f.length, 16384, function (k) {
              return f.charCodeAt(k) - 32;
            });
      },
      rf: function (f) {
        f = d.pe(f);
        for (
          var k = new Uint8Array(2 * f.length), n = 0, m = f.length;
          m > n;
          n++
        ) {
          var p = f.charCodeAt(n);
          k[2 * n] = p >>> 8;
          k[2 * n + 1] = p % 256;
        }
        return k;
      },
      uf: function (f) {
        if (null === f || void 0 === f) return d.Gd(f);
        for (var k = Array(f.length / 2), n = 0, m = k.length; m > n; n++)
          k[n] = 256 * f[2 * n] + f[2 * n + 1];
        var p = [];
        return (
          k.forEach(function (r) {
            p.push(b(r));
          }),
          d.Gd(p.join(""))
        );
      },
      Fc: function (f) {
        return null == f
          ? ""
          : d.xc(f, 6, function (k) {
              return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$".charAt(
                k
              );
            });
      },
      qe: function (f) {
        return null == f
          ? ""
          : "" == f
          ? null
          : ((f = f.replace(/ /g, "+")),
            d.yc(f.length, 32, function (k) {
              return a(
                "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",
                f.charAt(k)
              );
            }));
      },
      pe: function (f) {
        return d.xc(f, 16, function (k) {
          return b(k);
        });
      },
      xc: function (f, k, n) {
        if (null == f) return "";
        var m,
          p,
          r = {},
          w = {},
          z = "",
          I = "",
          N = "",
          C = 2,
          G = 3,
          H = 2,
          x = [],
          v = 0,
          D = 0;
        for (p = 0; p < f.length; p += 1)
          if (
            ((z = f.charAt(p)),
            Object.prototype.hasOwnProperty.call(r, z) ||
              ((r[z] = G++), (w[z] = !0)),
            (I = N + z),
            Object.prototype.hasOwnProperty.call(r, I))
          )
            N = I;
          else {
            if (Object.prototype.hasOwnProperty.call(w, N)) {
              if (256 > N.charCodeAt(0)) {
                for (m = 0; H > m; m++)
                  (v <<= 1),
                    D == k - 1 ? ((D = 0), x.push(n(v)), (v = 0)) : D++;
                var E = N.charCodeAt(0);
                for (m = 0; 8 > m; m++)
                  (v = (v << 1) | (1 & E)),
                    D == k - 1 ? ((D = 0), x.push(n(v)), (v = 0)) : D++,
                    (E >>= 1);
              } else {
                E = 1;
                for (m = 0; H > m; m++)
                  (v = (v << 1) | E),
                    D == k - 1 ? ((D = 0), x.push(n(v)), (v = 0)) : D++,
                    (E = 0);
                E = N.charCodeAt(0);
                for (m = 0; 16 > m; m++)
                  (v = (v << 1) | (1 & E)),
                    D == k - 1 ? ((D = 0), x.push(n(v)), (v = 0)) : D++,
                    (E >>= 1);
              }
              C--;
              0 == C && ((C = Math.pow(2, H)), H++);
              delete w[N];
            } else
              for (E = r[N], m = 0; H > m; m++)
                (v = (v << 1) | (1 & E)),
                  D == k - 1 ? ((D = 0), x.push(n(v)), (v = 0)) : D++,
                  (E >>= 1);
            C--;
            0 == C && ((C = Math.pow(2, H)), H++);
            r[I] = G++;
            N = String(z);
          }
        if ("" !== N) {
          if (Object.prototype.hasOwnProperty.call(w, N)) {
            if (256 > N.charCodeAt(0)) {
              for (m = 0; H > m; m++)
                (v <<= 1), D == k - 1 ? ((D = 0), x.push(n(v)), (v = 0)) : D++;
              E = N.charCodeAt(0);
              for (m = 0; 8 > m; m++)
                (v = (v << 1) | (1 & E)),
                  D == k - 1 ? ((D = 0), x.push(n(v)), (v = 0)) : D++,
                  (E >>= 1);
            } else {
              E = 1;
              for (m = 0; H > m; m++)
                (v = (v << 1) | E),
                  D == k - 1 ? ((D = 0), x.push(n(v)), (v = 0)) : D++,
                  (E = 0);
              E = N.charCodeAt(0);
              for (m = 0; 16 > m; m++)
                (v = (v << 1) | (1 & E)),
                  D == k - 1 ? ((D = 0), x.push(n(v)), (v = 0)) : D++,
                  (E >>= 1);
            }
            C--;
            0 == C && ((C = Math.pow(2, H)), H++);
            delete w[N];
          } else
            for (E = r[N], m = 0; H > m; m++)
              (v = (v << 1) | (1 & E)),
                D == k - 1 ? ((D = 0), x.push(n(v)), (v = 0)) : D++,
                (E >>= 1);
          C--;
          0 == C && H++;
        }
        E = 2;
        for (m = 0; H > m; m++)
          (v = (v << 1) | (1 & E)),
            D == k - 1 ? ((D = 0), x.push(n(v)), (v = 0)) : D++,
            (E >>= 1);
        for (;;) {
          if (((v <<= 1), D == k - 1)) {
            x.push(n(v));
            break;
          }
          D++;
        }
        return x.join("");
      },
      Gd: function (f) {
        return null == f
          ? ""
          : "" == f
          ? null
          : d.yc(f.length, 32768, function (k) {
              return f.charCodeAt(k);
            });
      },
      yc: function (f, k, n) {
        var m,
          p,
          r = [],
          w = 4,
          z = 4,
          I = 3,
          N = [],
          C = n(0),
          G = k,
          H = 1;
        for (m = 0; 3 > m; m += 1) r[m] = m;
        var x = 0;
        var v = Math.pow(2, 2);
        for (p = 1; p != v; ) {
          var D = C & G;
          G >>= 1;
          0 == G && ((G = k), (C = n(H++)));
          x |= (0 < D ? 1 : 0) * p;
          p <<= 1;
        }
        switch (x) {
          case 0:
            x = 0;
            v = Math.pow(2, 8);
            for (p = 1; p != v; )
              (D = C & G),
                (G >>= 1),
                0 == G && ((G = k), (C = n(H++))),
                (x |= (0 < D ? 1 : 0) * p),
                (p <<= 1);
            var E = b(x);
            break;
          case 1:
            x = 0;
            v = Math.pow(2, 16);
            for (p = 1; p != v; )
              (D = C & G),
                (G >>= 1),
                0 == G && ((G = k), (C = n(H++))),
                (x |= (0 < D ? 1 : 0) * p),
                (p <<= 1);
            E = b(x);
            break;
          case 2:
            return "";
        }
        m = r[3] = E;
        for (N.push(E); ; ) {
          if (H > f) return "";
          x = 0;
          v = Math.pow(2, I);
          for (p = 1; p != v; )
            (D = C & G),
              (G >>= 1),
              0 == G && ((G = k), (C = n(H++))),
              (x |= (0 < D ? 1 : 0) * p),
              (p <<= 1);
          switch ((E = x)) {
            case 0:
              x = 0;
              v = Math.pow(2, 8);
              for (p = 1; p != v; )
                (D = C & G),
                  (G >>= 1),
                  0 == G && ((G = k), (C = n(H++))),
                  (x |= (0 < D ? 1 : 0) * p),
                  (p <<= 1);
              r[z++] = b(x);
              E = z - 1;
              w--;
              break;
            case 1:
              x = 0;
              v = Math.pow(2, 16);
              for (p = 1; p != v; )
                (D = C & G),
                  (G >>= 1),
                  0 == G && ((G = k), (C = n(H++))),
                  (x |= (0 < D ? 1 : 0) * p),
                  (p <<= 1);
              r[z++] = b(x);
              E = z - 1;
              w--;
              break;
            case 2:
              return N.join("");
          }
          if ((0 == w && ((w = Math.pow(2, I)), I++), r[E])) E = r[E];
          else {
            if (E !== z) return null;
            E = m + m.charAt(0);
          }
          N.push(E);
          r[z++] = m + E.charAt(0);
          w--;
          m = E;
          0 == w && ((w = Math.pow(2, I)), I++);
        }
      },
    };
  return d;
})();
"function" == typeof define && define.le
  ? define(function () {
      return le_$c;
    })
  : "undefined" != typeof module && null != module && (module.exports = le_$c);
(function () {
  function a(b, c, d) {
    if ("undefined" === typeof d || 0 === +d) return Math[b](c);
    c = +c;
    d = +d;
    if (isNaN(c) || "number" !== typeof d || 0 !== d % 1) return NaN;
    if (0 > c) return -a(b, -c, d);
    c = c.toString().split("e");
    c = Math[b](+(c[0] + "e" + (c[1] ? +c[1] - d : -d)));
    c = c.toString().split("e");
    return +(c[0] + "e" + (c[1] ? +c[1] + d : d));
  }
  Math.tc ||
    (Math.tc = function (b, c) {
      return a("round", b, c);
    });
  Math.se ||
    (Math.se = function (b, c) {
      return a("floor", b, c);
    });
  Math.me ||
    (Math.me = function (b, c) {
      return a("ceil", b, c);
    });
})();
class le_ad {
  constructor() {
    const a = this;
    a.l = {};
    a.j = {};
    a.i = {};
    a.g = {};
    $.each(monolithRewards.monolithRewardRollGroups, function (b, c) {
      if (1 == c.timelineCompatibility.length) {
        b = c.timelineCompatibility[0];
        const d = [],
          f = [];
        a.l[b] = d;
        a.j[b] = f;
        $.each(c.droppableRewards, function (k, n) {
          const m = monolithRewards.monolithRewards[n];
          f.push(m);
          $.each(m.rolls, function (p, r) {
            $.each(r.dropInfo.potentialBaseIDs, function (w, z) {
              w = a.g;
              var I = null != m.titleKey ? le_b(m.titleKey) : m.title;
              w[z] = I;
              d.push(z);
            });
          });
        });
      }
    });
    $.each(a.l, function (b, c) {
      $.each(c, function (d, f) {
        a.i[f] = b;
      });
    });
  }
}
function le_bd(a, b) {
  window.localStorage.setItem(a, JSON.stringify(b));
}
class le_cd {
  load(a, b) {
    a = window.localStorage.getItem(a);
    return null == a ? b : JSON.parse(a);
  }
}
class le_dd {
  constructor() {
    this.g = new le_cd();
  }
}
const le_ed = new le_dd();
function le_fd(a, b) {
  const c = b.id;
  a.Ra[c] && (a.Ra[c] = b);
  a = userLootFilters.findIndex(function (d) {
    return d.id == c;
  });
  -1 != a && (userLootFilters[a] = b);
  a = sharedLootFilters.findIndex(function (d) {
    return d.id == c;
  });
  -1 != a && (sharedLootFilters[a] = b);
  2 != b.privacy && -1 != a && sharedLootFilters.splice(a, 1);
  2 == b.privacy && -1 == a && sharedLootFilters.push(b);
}
function le_gd(a, b) {
  delete a.Ra[b];
  a = userLootFilters.findIndex(function (c) {
    return c.id == b;
  });
  -1 != a && userLootFilters.splice(a, 1);
  a = sharedLootFilters.findIndex(function (c) {
    return c.id == b;
  });
  -1 != a && sharedLootFilters.splice(a, 1);
}
function le_hd(a, b) {
  a.Ra[b.id] = b;
  userLootFilters.push(b);
}
class le_id {
  constructor() {
    this.init();
  }
  init() {
    const a = this;
    a.Ra = {};
    sharedLootFilters.forEach(function (b) {
      a.Ra[b.id] = b;
    });
    userLootFilters.forEach(function (b) {
      a.Ra[b.id] = b;
    });
    myUser && (authors[myUser.id] = myUser.name);
  }
}
function le_jd(a) {
  return `<span class="highlighted">${a}</span>`;
}
class le_kd {
  constructor(a) {
    this.U = ++le_D.B;
    this.Ua = a;
  }
  O() {
    return this.U;
  }
  bb() {
    throw Error("Not implemented");
  }
  aa() {
    throw Error("Not implemented");
  }
  match() {
    throw Error("Not implemented");
  }
  yb() {
    throw Error("Not implemented");
  }
  clone() {
    throw Error("Not implemented");
  }
}
class le_ld extends le_kd {
  constructor() {
    super(le_md);
  }
  bb() {
    return !1;
  }
  aa() {
    return "";
  }
  match() {
    return !0;
  }
  yb() {
    return [this.Ua, []];
  }
  clone() {
    const a = new le_ld();
    a.U = this.U;
    return a;
  }
}
function le_nd(a) {
  switch (a) {
    case le_od:
      return "=";
    case le_pd:
      return "<";
    case le_qd:
      return "<=";
    case le_rd:
      return ">";
    case le_E:
      return ">=";
  }
  return "";
}
function le_sd(a) {
  switch (a) {
    case le_F:
      return "";
    case le_od:
      return "to";
    case le_pd:
      return "than";
    case le_qd:
      return "to";
    case le_rd:
      return "than";
    case le_E:
      return "to";
    default:
      return "";
  }
}
function le_td(a, b, c) {
  switch (a) {
    case le_od:
      return b == c;
    case le_pd:
      return b < c;
    case le_qd:
      return b <= c;
    case le_rd:
      return b > c;
    case le_E:
      return b >= c;
  }
  return !0;
}
class le_G extends le_kd {
  constructor(a = [], b = 1, c = !1, d = le_F, f = 1, k = le_F, n = 1) {
    super(le_ud);
    this.pa = a;
    this.wa = b;
    this.Ca = c;
    this.va = d;
    this.La = f;
    this.sa = k;
    this.Fa = n;
  }
  bb() {
    return 0 < this.wa && 0 < this.pa.length;
  }
  aa(a) {
    var b = this.pa;
    const c = this.wa,
      d = b.length;
    let f = null,
      k = null,
      n = null,
      m = null;
    this.Ca &&
      (this.va != le_F && ((k = le_nd(this.va)), (f = this.La)),
      this.sa != le_F && ((m = le_nd(this.sa)), (n = this.Fa)));
    a = a ? "" : "highlighted";
    return 1 == d
      ? ((b = $db.getItemName(le_A[b[0]])),
        null != f && null != n
          ? le_.t(
              "loot_filters.rule_name.affix_condition.with_n_tiers_of_affix_name_and_tier_sum",
              {
                affixName: b,
                tierComparison: k,
                tierCount: f,
                totalTierComparison: m,
                totalTierCount: n,
              },
              a
            )
          : null != f
          ? le_.t(
              "loot_filters.rule_name.affix_condition.with_n_tiers_of_affix_name",
              { affixName: b, tierComparison: k, tierCount: f },
              a
            )
          : null != n
          ? le_.t(
              "loot_filters.rule_name.affix_condition.with_affix_name_and_tier_sum",
              { affixName: b, totalTierComparison: m, totalTierCount: n },
              a
            )
          : le_.t(
              "loot_filters.rule_name.affix_condition.with_affix_name",
              { affixName: b },
              a
            ))
      : 1 < c
      ? null != f && null != n
        ? le_.t(
            "loot_filters.rule_name.affix_condition.with_n_tiers_of_min_of_x_affixes_and_tier_sum",
            {
              minCount: c,
              totalCount: d,
              tierComparison: k,
              tierCount: f,
              totalTierComparison: m,
              totalTierCount: n,
            },
            a
          )
        : null != f
        ? le_.t(
            "loot_filters.rule_name.affix_condition.with_n_tiers_of_min_of_x_affixes",
            { minCount: c, totalCount: d, tierComparison: k, tierCount: f },
            a
          )
        : null != n
        ? le_.t(
            "loot_filters.rule_name.affix_condition.with_min_of_x_affixes_and_tier_sum",
            {
              minCount: c,
              totalCount: d,
              totalTierComparison: m,
              totalTierCount: n,
            },
            a
          )
        : le_.t(
            "loot_filters.rule_name.affix_condition.with_min_of_x_affixes",
            { minCount: c, totalCount: d },
            a
          )
      : null != f && null != n
      ? le_.t(
          "loot_filters.rule_name.affix_condition.with_n_tiers_of_x_affixes_and_tier_sum",
          {
            totalCount: d,
            tierComparison: k,
            tierCount: f,
            totalTierComparison: m,
            totalTierCount: n,
          },
          a
        )
      : null != f
      ? le_.t(
          "loot_filters.rule_name.affix_condition.with_n_tiers_of_x_affixes",
          { totalCount: d, tierComparison: k, tierCount: f },
          a
        )
      : null != n
      ? le_.t(
          "loot_filters.rule_name.affix_condition.with_x_affixes_and_tier_sum",
          { totalCount: d, totalTierComparison: m, totalTierCount: n },
          a
        )
      : le_.t(
          "loot_filters.rule_name.affix_condition.with_x_affixes",
          { totalCount: d },
          a
        );
  }
  match(a) {
    return this.ta(a);
  }
  yb() {
    return [
      this.Ua,
      [this.pa, this.wa, this.Ca ? 1 : 0, this.va, this.La, this.sa, this.Fa],
    ];
  }
  clone() {
    const a = new le_G(
      this.pa.slice(),
      this.wa,
      this.Ca,
      this.va,
      this.La,
      this.sa,
      this.Fa
    );
    a.U = this.U;
    return a;
  }
  ta(a) {
    const b = this;
    if (0 == b.pa.length) return !0;
    let c = [];
    a.compositeMods.forEach(function (d) {
      b.pa.includes(d.rawAffixId) && c.push(d);
    });
    if (c.length < b.wa) return !1;
    if (b.Ca) {
      if (b.va != le_F) {
        a = 0;
        for (let d = 0; d < c.length; d++)
          le_td(b.va, c[d].tier || 1, b.La) && a++;
        if (a < b.wa) return !1;
      }
      if (b.sa != le_F) {
        let d = 0;
        c.forEach(function (f) {
          d += f.tier || 1;
        });
        if (!le_td(b.sa, d, b.Fa)) return !1;
      }
    }
    return !0;
  }
}
function le_vd(a, b) {
  a.ua = b;
}
class le_H extends le_kd {
  constructor(a = []) {
    super(le_wd);
    this.ua = a;
  }
  bb() {
    return 0 < this.ua.length;
  }
  aa(a) {
    const b = this;
    if (b.ua.length == le_D.g.length)
      return le_.t("loot_filters.rule_name.class_condition.any_class_specific");
    const c = [];
    le_D.g.forEach(function (d) {
      -1 != b.ua.indexOf(d.id) &&
        ((d = le_Sa(d.Lb, !1)), c.push(a ? d : le_jd(d)));
    });
    return le_.t("loot_filters.rule_name.class_condition.class_specific", {
      className: c.join(", "),
    });
  }
  match(a) {
    return this.ta(a);
  }
  yb() {
    return [this.Ua, [this.ua]];
  }
  clone() {
    const a = new le_H(this.ua.slice());
    a.U = this.U;
    return a;
  }
  ta(a) {
    if (0 == this.ua.length) return !0;
    a = a.classRequirement;
    return a != le_B.None && -1 != this.ua.indexOf(a);
  }
  Sa(a) {
    if (0 == this.ua.length) return !0;
    const b = a.classSpecificity || le_C.None;
    return (
      b == le_C.None ||
      this.ua.some(function (c) {
        return (
          (c == le_B.Primalist && (b & le_C.Primalist) == le_C.Primalist) ||
          (c == le_B.Mage && (b & le_C.Mage) == le_C.Mage) ||
          (c == le_B.Sentinel && (b & le_C.Sentinel) == le_C.Sentinel) ||
          (c == le_B.Acolyte && (b & le_C.Acolyte) == le_C.Acolyte) ||
          (c == le_B.Rogue && (b & le_C.Rogue) == le_C.Rogue)
        );
      })
    );
  }
}
class le_xd extends le_kd {
  constructor(a = le_yd, b = 0) {
    super(le_zd);
    this.Ya = a;
    this.Xa = b;
  }
  bb() {
    return !0;
  }
  aa(a) {
    const b = this.Xa;
    switch (this.Ya) {
      case le_yd:
        return a ? `ilvl <= ${b}` : `ilvl &lt;= ${le_jd(b)}`;
      case le_Ad:
        return a ? `ilvl >= ${b}` : `ilvl &gt;= ${le_jd(b)}`;
      case le_Bd:
        return a ? `ilvl ${b} below char` : `ilvl ${le_jd(b)} below char`;
      case le_Cd:
        return le_.t("loot_filters.rule_name.level_condition.highest_usable");
    }
    return "";
  }
  match(a) {
    return this.ta(a);
  }
  yb() {
    return [this.Ua, [this.Ya, this.Xa]];
  }
  clone() {
    const a = new le_xd(this.Ya, this.Xa);
    a.U = this.U;
    return a;
  }
  ta(a) {
    a = $db.getLevelRequirement(a);
    switch (this.Ya) {
      case le_yd:
        return a <= this.Xa;
      case le_Ad:
        return a >= this.Xa;
    }
    return !0;
  }
}
function le_Dd(a, b) {
  a.Ma = b;
}
class le_I extends le_kd {
  constructor(a = []) {
    super(le_Ed);
    this.Ma = a;
  }
  bb() {
    return 0 < this.Ma.length;
  }
  aa(a) {
    const b = this,
      c = [];
    le_D.l.forEach(function (d) {
      if (-1 != b.Ma.indexOf(d.id)) {
        const f = le_Fd(d.id);
        c.push(a ? f : `<span style="color:${d.color}">${f}</span>`);
      }
    });
    return c.join(" / ");
  }
  match(a) {
    return this.ta(a);
  }
  yb() {
    return [this.Ua, [this.Ma]];
  }
  clone() {
    const a = new le_I(this.Ma.slice());
    a.U = this.U;
    return a;
  }
  ta(a) {
    if (0 == this.Ma.length) return !0;
    a = le_Gd(a);
    return -1 != this.Ma.indexOf(a);
  }
}
class le_J extends le_kd {
  constructor(a = [], b = []) {
    super(le_Hd);
    this.ra = a;
    this.Ea = b;
  }
  bb() {
    return 0 < this.ra.length;
  }
  aa(a) {
    const b = this.ra;
    var c = this.Ea;
    if (1 == b.length) {
      const d = itemDB.itemList.equippable[b[0]],
        f = le_d(d);
      if (0 == c.length) return f;
      if (1 == c.length) return le_d(d.subItems[c[0]]);
      if (1 < c.length)
        return le_.t(
          "loot_filters.rule_name.item_type_condition.x_subtypes_of_type",
          { count: c.length, itemType: f },
          a ? "" : "highlighted"
        );
    } else {
      const d = {};
      itemDB.itemList.lootFilterVisualCategories.forEach(function (f) {
        f.categories.forEach(function (k) {
          k.entries.forEach(function (n) {
            -1 != b.indexOf(n) && (d[le_Ha(k)] = !0);
          });
        });
      });
      c = Object.keys(d);
      return 1 == c.length
        ? le_.t(
            "loot_filters.rule_name.item_type_condition.x_types_of_category",
            { count: b.length, itemCategory: c[0] },
            a ? "" : "highlighted"
          )
        : le_.t(
            "loot_filters.rule_name.item_type_condition.x_types",
            { count: b.length },
            a ? "" : "highlighted"
          );
    }
    return "";
  }
  match(a) {
    return this.ta(a);
  }
  yb() {
    return [this.Ua, [this.ra, this.Ea]];
  }
  clone() {
    const a = new le_J(this.ra.slice(), this.Ea.slice());
    a.U = this.U;
    return a;
  }
  ta(a) {
    return 0 == this.ra.length
      ? !0
      : -1 != this.ra.indexOf(a.baseTypeId)
      ? 0 == this.Ea.length
        ? !0
        : -1 != this.Ea.indexOf(a.subTypeId)
      : !1;
  }
  Sa(a) {
    const b = this;
    return (
      0 == b.ra.length ||
      a.canRollOn.some(function (c) {
        return b.ra.includes(c);
      })
    );
  }
}
class le_Id {
  constructor(a, b = !1, c = !1) {
    this.ke = a;
    this.wd = b;
    this.xd = c;
  }
  Ae() {
    return this.wd;
  }
  Ce() {
    return this.xd;
  }
}
function le_Jd(a) {
  return null != a.xa && "" != a.xa.trim();
}
function le_Kd(a) {
  return le_Ld(a, function (b) {
    return b instanceof le_G;
  });
}
function le_Md(a) {
  return le_Ld(a, function (b) {
    return b instanceof le_H;
  });
}
function le_Nd(a) {
  return le_Ld(a, function (b) {
    return b instanceof le_xd;
  });
}
function le_Od(a) {
  return le_Ld(a, function (b) {
    return b instanceof le_I;
  });
}
function le_Pd(a) {
  return le_Ld(a, function (b) {
    return b instanceof le_J;
  });
}
function le_Qd(a, b) {
  const c = le_Kd(a),
    d = le_Md(a),
    f = le_Nd(a),
    k = le_Od(a);
  a = le_Pd(a);
  return (
    a
      ? le_.t("loot_filters.rule_name.component_order.specific_item_type", {
          classCondition: d ? d.aa(b) : "",
          levelCondition: f ? f.aa(b) : "",
          rarityCondition: k ? k.aa(b) : "",
          affixCondition: c ? c.aa(b) : "",
          itemType: a.aa(b),
        })
      : le_.t("loot_filters.rule_name.component_order.no_item_type", {
          classCondition: d ? d.aa(b) : "",
          levelCondition: f ? f.aa(b) : "",
          rarityCondition: k ? k.aa(b) : "",
          affixCondition: c ? c.aa(b) : "",
        })
  )
    .replace(/ +/g, " ")
    .trim();
}
function le_Rd(a) {
  var b = le_D.j.find(function (d) {
    return d == a.ma;
  });
  let c = "";
  a.Ga &&
    (c =
      "text-decoration:underline dotted 1.6px!important;text-underline-offset:2.5px;");
  switch (a.ma) {
    case le_K:
      c += "color:#FFF";
      break;
    case le_L:
      c += "color:#FFF";
      break;
    case le_M:
      c += `color:${lootFilterRuleColors[a.Da].primary.lightColor}`;
  }
  b = le_Sd(b);
  return `<span style="${c}">${b}</span>`;
}
function le_Ld(a, b) {
  return (a = a.qa.find(b)) ? (a.bb() ? a : null) : null;
}
function le_Td(a, b, c) {
  const d = le_Md(a),
    f = le_Nd(a),
    k = itemDB.itemList.equippable[b];
  return c.every(function (n) {
    n = k.subItems[n];
    return (!d || d.ta(n)) && (!f || f.ta(n));
  });
}
function le_Ud(a, b) {
  const c = le_Md(a),
    d = le_Pd(a);
  return b.every(function (f) {
    f = le_A[f];
    return (!c || c.Sa(f)) && (!d || d.Sa(f));
  });
}
class le_N {
  constructor(a = null, b = le_K, c = 0, d = !1, f = null, k = [], n = !1) {
    this.U = ++le_D.C;
    this.xa = a;
    this.ma = b;
    this.Da = c;
    this.Ga = d;
    this.Z = f;
    this.qa = k;
    this.Va = n;
  }
  O() {
    return this.U;
  }
  setColor(a) {
    this.Da = a;
  }
  Zc(a) {
    this.qa = this.qa.filter(function (b) {
      return b.O() !== a.O();
    });
  }
  match(a) {
    for (let b = 0; b < this.qa.length; b++) {
      const c = this.qa[b];
      if (!c.bb() || !c.match(a)) return !1;
    }
    return !0;
  }
  copyTo(a) {
    a.xa = this.xa;
    a.ma = this.ma;
    a.Da = this.Da;
    a.Ga = this.Ga;
    a.Z = null == this.Z ? null : $.extend({}, this.Z);
    a.qa.length = 0;
    this.qa.forEach(function (b) {
      a.qa.push(b.clone());
    });
    a.Va = this.Va;
  }
  clone() {
    const a = new le_N();
    this.copyTo(a);
    a.U = this.U;
    return a;
  }
}
class le_Vd {
  constructor(
    a = null,
    b = null,
    c = null,
    d = "0,0",
    f = [],
    k = 1,
    n = Date.now(),
    m = Date.now(),
    p = null,
    r = myUserId,
    w = [],
    z = [],
    I = [],
    N = 0,
    C = 0,
    G = null
  ) {
    this.U = ++le_Wd.i;
    this.Sc = a;
    this.Na = b;
    this.ec = c;
    this.Wa = d;
    this.da = f;
    this.Vc = k;
    this.vd = n;
    this.zd = m;
    this.Ka = p;
    this.Rc = r;
    this.Fb = w;
    this.Hb = z;
    this.Cc = I;
    this.Ac = N;
    this.Uc = C;
    this.je = G;
  }
  O() {
    return this.U;
  }
  aa() {
    return this.ec;
  }
  getTags() {
    return this.Cc;
  }
  deleteRule(a) {
    this.da = this.da.filter(function (b) {
      return b.O() !== a.O();
    });
  }
  match(a, b) {
    if (100 < a.baseTypeId) return new le_Id(null, !0);
    for (let c = 0; c < this.da.length; c++) {
      const d = this.da[c];
      if (
        !d.Va &&
        (null == d.Z || (b >= d.Z.min && b <= d.Z.max)) &&
        d.match(a)
      )
        return new le_Id(d);
    }
    return new le_Id(null, !0, !0);
  }
  copyTo(a) {
    a.Na = this.Na;
    a.ec = this.ec;
    a.Wa = this.Wa;
    a.da.length = 0;
    this.da.forEach(function (b) {
      a.da.push(b.clone());
    });
    a.Ka = this.Ka;
    a.Fb = this.Fb.slice();
    a.Hb = this.Hb.slice();
    a.Cc = this.Cc.slice();
  }
  clone() {
    const a = new le_Vd();
    this.copyTo(a);
    a.U = this.U;
    return a;
  }
}
function le_Xd(a) {
  const b = a.baseTypeId;
  if (101 <= b && 103 >= b) return masterColors[7];
  if (104 == b) return masterColors[8];
  if (105 == b) return masterColors[9];
  if (34 == b) return masterColors[12];
  switch ($db.getItemRarity(a)) {
    case 0:
      return masterColors[0];
    case 1:
    case 2:
      return $db.ab.includes(b) ? masterColors[6] : masterColors[1];
    case 3:
    case 4:
      return masterColors[2];
    case 5:
    case 6:
      return masterColors[0];
    case 7:
      return masterColors[3];
    case 8:
      return masterColors[4];
    case 9:
      return masterColors[5];
    case 10:
      return masterColors[11];
    case 11:
      return masterColors[16];
    case 12:
      return masterColors[17];
    default:
      return masterColors[0];
  }
}
function le_Yd(a) {
  switch (a) {
    case "beginner":
      return le_.t("loot_filters.tag.beginner");
    case "leveling":
      return le_.t("loot_filters.tag.leveling");
    case "endgame":
      return le_.t("loot_filters.tag.endgame");
    case "hardcore":
      return le_.t("loot_filters.tag.hardcore");
  }
}
function le_Zd(a) {
  switch (a) {
    case 0:
      return le_.t("loot_filters.privacy.private");
    case 1:
      return le_.t("loot_filters.privacy.unlisted");
    case 2:
      return le_.t("loot_filters.privacy.shared");
  }
}
class le__d {
  constructor() {
    this.i = 0;
    this.Qa = ["beginner", "leveling", "endgame", "hardcore"];
    this.g = [0, 1, 2];
  }
}
const le_Wd = new le__d();
function le_Fd(a) {
  switch (a) {
    case le_O:
      return le_.t("loot_filters.item_rarity.normal");
    case le_P:
      return le_.t("loot_filters.item_rarity.magic");
    case le_Q:
      return le_.t("loot_filters.item_rarity.rare");
    case le_R:
      return le_.t("loot_filters.item_rarity.exalted");
    case le_0d:
      return le_.t("loot_filters.item_rarity.unique");
    case le_1d:
      return le_.t("loot_filters.item_rarity.set");
  }
}
function le_Gd(a) {
  switch ($db.getItemRarity(a)) {
    case 0:
      return le_O;
    case 1:
    case 2:
      return le_P;
    case 3:
    case 4:
      return le_Q;
    case 5:
    case 6:
      return le_O;
    case 7:
      return le_0d;
    case 8:
      return le_1d;
    case 9:
      return le_2d;
    case 10:
      return le_R;
    case 11:
    case 12:
      if (a.hasExaltedAffix) return le_R;
      switch (a.affixCount || 0) {
        case 0:
          return le_O;
        case 1:
        case 2:
          return le_P;
        case 3:
        case 4:
          return le_Q;
      }
    default:
      return le_O;
  }
}
function le_Sd(a) {
  switch (a) {
    case le_K:
      return le_.t("loot_filters.visibility.show");
    case le_L:
      return le_.t("loot_filters.visibility.hide");
    case le_M:
      return le_.t("loot_filters.visibility.recolor");
  }
}
function le_3d(a) {
  switch (a) {
    case 0:
      return le_.t("loot_filters.rule_condition.none");
    case 1:
      return le_.t("loot_filters.rule_condition.affix");
    case 2:
      return le_.t("loot_filters.rule_condition.class");
    case 3:
      return le_.t("loot_filters.rule_condition.level");
    case 4:
      return le_.t("loot_filters.rule_condition.rarity");
    case 5:
      return le_.t("loot_filters.rule_condition.type");
  }
}
function le_4d(a) {
  switch (a) {
    case le_yd:
      return le_.t("loot_filters.level_condition_type.below_level");
    case le_Ad:
      return le_.t("loot_filters.level_condition_type.above_level");
    case le_Bd:
      return le_.t("loot_filters.level_condition_type.max_before_char_level");
    case le_Cd:
      return le_.t("loot_filters.level_condition_type.highest_usable_level");
  }
}
function le_5d(a) {
  switch (a) {
    case le_F:
      return le_.t("loot_filters.affix_comparison.any");
    case le_od:
      return le_.t("loot_filters.affix_comparison.equal");
    case le_pd:
      return le_.t("loot_filters.affix_comparison.less");
    case le_qd:
      return le_.t("loot_filters.affix_comparison.less_or_equal");
    case le_rd:
      return le_.t("loot_filters.affix_comparison.more");
    case le_E:
      return le_.t("loot_filters.affix_comparison.more_or_equal");
  }
}
function le_6d(a) {
  switch (a) {
    case 0:
      return new le_ld();
    case 1:
      return new le_G();
    case 2:
      return new le_H();
    case 3:
      return new le_xd();
    case 4:
      return new le_I();
    case 5:
      return new le_J();
    default:
      return new le_ld();
  }
}
class le_7d {
  constructor() {
    this.B = this.C = 0;
    this.j = [le_K, le_L, le_M];
    this.o = [1, 2, 3, 4, 5, 0];
    this.g = [
      { id: le_B.Primalist, Lb: 0 },
      { id: le_B.Mage, Lb: 1 },
      { id: le_B.Sentinel, Lb: 2 },
      { id: le_B.Acolyte, Lb: 3 },
      { id: le_B.Rogue, Lb: 4 },
    ];
    this.l = [
      { id: le_O, color: "#FFFFFF" },
      { id: le_P, color: "#36A3E2" },
      { id: le_Q, color: "#E3D157" },
      { id: le_R, color: "#C184FF" },
      { id: le_0d, color: "rgba(235, 115, 10, 0.8)" },
      { id: le_1d, color: "rgba(113, 232, 125, 0.8)" },
    ];
    this.m = [le_yd, le_Ad, le_Bd, le_Cd];
    this.i = [le_F, le_od, le_pd, le_qd, le_rd, le_E];
  }
}
var le_md = 0,
  le_ud = 1,
  le_wd = 2,
  le_zd = 3,
  le_Ed = 4,
  le_Hd = 5,
  le_K = 0,
  le_L = 1,
  le_M = 2,
  le_O = 1,
  le_P = 2,
  le_Q = 4,
  le_0d = 8,
  le_1d = 16,
  le_2d = 32,
  le_R = 64,
  le_yd = 0,
  le_Ad = 1,
  le_Bd = 2,
  le_Cd = 3,
  le_F = 0,
  le_od = 1,
  le_pd = 2,
  le_qd = 3,
  le_rd = 4,
  le_E = 5;
const le_D = new le_7d();
async function le_8d(a, b, c, d) {
  try {
    const f = await (
      await window.showSaveFilePicker({
        suggestedName: a,
        types: [{ accept: { "text/xml": [".xml"] } }],
      })
    ).createWritable();
    await f.write(b);
    await f.close();
    c();
  } catch (f) {
    "AbortError" !== f.name && (console.error(f.name, f.message), d());
  }
}
function le_9d(a, b, c) {
  const d = window.URL.createObjectURL(b),
    f = document.createElement("a");
  f.href = d;
  f.download = a;
  f.style.display = "none";
  document.body.append(f);
  f.click();
  setTimeout(() => {
    window.URL.revokeObjectURL(d);
    f.remove();
  }, 1e3);
  c();
}
async function le_$d(a, b, c, d) {
  le_ae.g ? le_8d(a, b, c, d) : le_9d(a, b, c);
}
class le_be {
  constructor() {
    var a;
    if ((a = "showSaveFilePicker" in window))
      try {
        a = window.self === window.top;
      } catch {
        a = !1;
      }
    this.g = a;
  }
}
const le_ae = new le_be();
function le_ce(a) {
  return a[le_S(0, a.length)];
}
function le_de(a) {
  const b = [];
  Object.values(a.subItems).forEach(function (c) {
    1 != c.cannotDrop && b.push(c);
  });
  return le_ce(b);
}
function le_S(a, b) {
  a = Math.ceil(a);
  b = Math.floor(b);
  return Math.floor(Math.random() * (b - a) + a);
}
function le_T(a, b, c, d, f) {
  const k = [];
  Object.values(a).forEach(function (n) {
    if ((null == d || n.affixId != d.affixId) && n.canRollOn.includes(b)) {
      const m = n.classSpecificity || le_C.None;
      (m == le_C.None ||
        (c == le_B.None && (m & le_C.NonSpecific) == le_C.NonSpecific) ||
        (c == le_B.Primalist && (m & le_C.Primalist) == le_C.Primalist) ||
        (c == le_B.Mage && (m & le_C.Mage) == le_C.Mage) ||
        (c == le_B.Sentinel && (m & le_C.Sentinel) == le_C.Sentinel) ||
        (c == le_B.Acolyte && (m & le_C.Acolyte) == le_C.Acolyte) ||
        (c == le_B.Rogue && (m & le_C.Rogue) == le_C.Rogue)) &&
        ((f && 2 == n.specialAffixType) || (!f && 2 != n.specialAffixType)) &&
        k.push(n);
    }
  });
  return le_ce(k);
}
function le_ee() {
  const a = le_ce($db.lc),
    b = le_de(itemDB.itemList.equippable[a]),
    c = b.classRequirement;
  let d = null,
    f = null;
  le_S(0, 2) && ((d = le_T(le_t, a, c)), (f = le_S(1, le_S(0, 2) ? 8 : 6)));
  let k = null,
    n = null;
  le_S(0, 2) && ((k = le_T(le_t, a, c, d)), (n = le_S(1, le_S(0, 2) ? 8 : 6)));
  let m = null,
    p = null;
  le_S(0, 2) && ((m = le_T(le_u, a, c)), (p = le_S(1, le_S(0, 2) ? 8 : 6)));
  let r = null,
    w = null;
  le_S(0, 2) && ((r = le_T(le_u, a, c, m)), (w = le_S(1, le_S(0, 2) ? 8 : 6)));
  return { item: b, gb: d, qb: k, kb: m, ub: r, ib: f, rb: n, lb: p, wb: w };
}
function le_fe() {
  var a = le_ce($db.ab);
  const b = le_de(itemDB.itemList.equippable[a]),
    c = b.classRequirement,
    d = le_T(le_t, a, c);
  a = le_T(le_u, a, c);
  return { item: b, gb: d, kb: a, ib: 1, lb: 1 };
}
function le_ge() {
  var a = le_ce($db.lc);
  const b = le_de(itemDB.itemList.equippable[a]),
    c = b.classRequirement,
    d = le_T(le_t, a, c, null, !0),
    f = le_S(1, 6),
    k = le_T(le_t, a, c, d),
    n = le_S(1, 6),
    m = le_T(le_u, a, c),
    p = le_S(1, 6);
  a = le_T(le_u, a, c, m);
  return {
    item: b,
    gb: d,
    kb: m,
    qb: k,
    ub: a,
    ib: f,
    lb: p,
    rb: n,
    wb: le_S(1, 6),
  };
}
class le_he {
  initData() {
    const a = this;
    a.i = [];
    a.g = [];
    Object.values(le_6c).forEach(function (b) {
      b.isSetItem ? a.g.push(b) : a.i.push(b);
    });
  }
}
const le_ie = new le_he();
function le_je(a, b) {
  let c = "",
    d = "";
  null != a && a.Ga && (c += "text-transform:uppercase;font-size:0.9em;");
  if (null != a && a.ma == le_M)
    if (((a = lootFilterRuleColors[a.Da]), null != b.uniqueId)) {
      var f = a.secondary.lightColor;
      c += `color:${f};background:${a.secondary.buttonColor};border:1px solid ${
        a.secondary.borderColor
      };text-shadow:${
        "rgba(0,0,0,255)" == f ? "0 0 1px #FFF" : "0 0 1px #000"
      };`;
    } else
      c += `color:${a.primary.lightColor};background:${a.primary.buttonColor};border:1px solid ${a.primary.borderColor};`;
  else {
    f = le_Xd(b);
    const r = f.lightColor;
    c += `color:${r};background:${f.buttonColor};border:1px solid ${f.borderColor};`;
    "rgba(255,255,255,255)" == r && (c += "text-shadow:0 0 1px #000;");
    null != a &&
      a.ma == le_L &&
      ((c += "opacity:0.6;"), (d += "text-decoration:line-through;"));
  }
  let k = "",
    n = "",
    m = "",
    p = "";
  b.compositeMods.forEach(function (r) {
    "prefix" == r.affixType
      ? ((m += '<span class="item-prefix-dot">&bull;</span>'), (k = le_Ea(r)))
      : "suffix" == r.affixType &&
        ((p += '<span class="item-suffix-dot">&bull;</span>'), (n = le_Ea(r)));
  });
  b = le_d(b);
  le_.g == le_.i && (b = (k + " " + b + " " + n).trim());
  return $(
    `<div class="simulated-item" style="${c}">${m}${`<span class="item-title" style="${d}">${b}</span>`}${p}</div>`
  );
}
function le_ke(a) {
  a.g = {};
  classInfoForSources.forEach(function (b, c) {
    const d = b.characterClass,
      f = b.thirdMasteryUnlocked,
      k = [],
      n = {};
    d.knownAbilities.forEach(function (p) {
      "ba1" != p && "na28" != p && le_le(k, p);
    });
    d.unlockableAbilities.forEach(function (p) {
      le_le(k, p.ability);
    });
    d.masteries.forEach(function (p, r) {
      if (f || 3 != r) {
        const w = [];
        p.abilities.forEach(function (z) {
          le_le(w, z.ability);
        });
        0 != r && le_le(w, p.masteryAbility);
        n[r] = 0 != r ? [].concat(n[0], k, w) : [].concat(k, w);
      }
    });
    const m = [];
    Object.values(n).forEach(function (p) {
      p.forEach(function (r) {
        le_le(m, r);
      });
    });
    n[0] = m;
    a.g[c] = n;
  });
}
function le_me(a) {
  a.i = {};
  for (let b = 0; 5 > b; b++) {
    const c = [];
    Object.entries(itemAilmentSources).forEach(function (d) {
      const [f, k] = d,
        n = [];
      k.forEach(function (m) {
        (m = le_t[m] || le_u[m]) && le_ne(m, b) && n.push(m);
      });
      0 < n.length &&
        c.push({ id: f, name: le_g(LEAbilities.ailmentList[f]), gf: n });
    });
    a.i[b] = c;
  }
}
function le_oe(a, b) {
  const c = [];
  le_pe.g[a][b].forEach(function (d) {
    c.push({ id: d, name: le_f(LEAbilities.abilityList[d]) });
  });
  c.sort(function (d, f) {
    return d.name.toLowerCase().localeCompare(f.name.toLowerCase());
  });
  return c;
}
function le_qe() {
  const a = [];
  Object.values(le_pe.g).forEach(function (b) {
    b[0].forEach(function (c) {
      a.push({ id: c, name: le_f(LEAbilities.abilityList[c]) });
    });
  });
  a.sort(function (b, c) {
    return b.name.toLowerCase().localeCompare(c.name.toLowerCase());
  });
  return a;
}
function le_re(a) {
  a = le_pe.i[a];
  a.sort(function (b, c) {
    return b.name.toLowerCase().localeCompare(c.name.toLowerCase());
  });
  return a;
}
function le_se(a, b, c, d) {
  const f = d.jc,
    k = d.Pb,
    n = d.Ha,
    m = d.Bb,
    p = d.Ab,
    r = d.zb,
    w = d.Cb,
    z = d.Db,
    I =
      AT.Minion |
      AT.DoT |
      AT.Channelling |
      AT.Totem |
      AT.Transform |
      AT.Potion |
      AT.LowLife |
      AT.HighLife |
      AT.FullLife |
      AT.Dodge_deprecated |
      AT.Crit_deprecated |
      AT.Kill_deprecated |
      AT.Die_deprecated,
    N = f == le_te,
    C = f == le_ue,
    G = f == le_ve,
    H = !C && (b == AT.Melee || b == AT.Bow || b == AT.Throwing),
    x = !C && b == AT.Spell,
    v = !C,
    D = k == le_we,
    E = k == le_xe,
    O = k == le_ye,
    U = [];
  Object.values(le_A).forEach(function (L) {
    let R = le_ze(le_U, L) && 2 != L.specialAffixType && le_ne(L, a);
    if (R)
      if (1 == L.affixProperties.length) R = !0;
      else {
        let F = !1;
        L.affixProperties.forEach(function (Z) {
          Z.property == SP.LevelOfSkills && 1 == Z.specialTag && (F = !0);
        });
        R = !F;
      }
    if (R) {
      let F = !1;
      L.affixProperties.forEach(function (Z) {
        const V = Z.property;
        var S = Z.specialTag;
        if (
          V == SP.Damage ||
          V == SP.GlobalConditionalDamage ||
          V == SP.Penetration ||
          (V == SP.AttackSpeed && H) ||
          (V == SP.CastSpeed && x) ||
          (V == SP.CriticalChance && v) ||
          (V == SP.CriticalMultiplier && v) ||
          (V == SP.AilmentChance && S == AilmentID.ArmourShred && v) ||
          (V == SP.AilmentChance && S == AilmentID.Frailty && v) ||
          (V == SP.ChannelCost && r) ||
          ((V == SP.AilmentChance ||
            V == SP.IncreasedAilmentDuration ||
            V == SP.IncreasedAilmentEffect) &&
            n.includes(S)) ||
          ((V == SP.IncreasedStunChance || V == SP.IncreasedStunDuration) &&
            m) ||
          ((V == SP.FreezeRateMultiplier ||
            V == SP.MoreFreezeRatePerStackOfChill) &&
            p)
        ) {
          S = Z.tags;
          const sa = (S & AT.Minion) == AT.Minion,
            na = (S & AT.DoT) == AT.DoT,
            ta = (S & AT.Channelling) == AT.Channelling,
            da = (S & AT.Totem) == AT.Totem,
            ka = (S & AT.Transform) == AT.Transform;
          S &= ~I;
          (S & AT.Elemental) != AT.Elemental ||
            (c != AT.Fire && c != AT.Cold && c != AT.Lightning) ||
            ((S &= ~AT.Elemental), (S |= c));
          Z =
            (V == SP.Damage || V == SP.GlobalConditionalDamage) &&
            0 == Z.modifierType;
          ((N && !na) || (C && !Z) || G) &&
            ((D && !sa) || (E && (sa || da)) || O) &&
            ((!r && !ta) || r) &&
            ((!w && !da) || w) &&
            ((!z && !ka) || z) &&
            (S == AT.None ||
              S == b ||
              S == c ||
              (b != AT.None && (S & b) == b && (S & c) == c)) &&
            (F = !0);
        }
      });
      F && U.push(L.affixId);
    }
  });
  return U;
}
function le_Ae(a, b, c, d) {
  const f = [];
  b.forEach(function (k) {
    c.forEach(function (n) {
      le_se(a, k, n, d).forEach(function (m) {
        f.includes(m) || f.push(m);
      });
    });
  });
  return f;
}
function le_le(a, b) {
  a.includes(b) || a.push(b);
}
class le_Be {
  initData() {
    le_ke(this);
    le_me(this);
  }
}
const le_pe = new le_Be();
var le_te = 0,
  le_ue = 1,
  le_ve = 2,
  le_we = 0,
  le_xe = 1,
  le_ye = 2;
class le_Ce {
  constructor(a, b, c, d) {
    this.title = a;
    this.color = b;
    this.Jb = c;
    this.$a = d;
  }
}
function le_De(a, b) {
  const c = a.$a.clone();
  c.pa = b;
  return { title: a.title, color: a.color, Jb: a.Jb, $a: c };
}
function le_Ee(a) {
  a = a.$a;
  const b = a.wa;
  let c = null,
    d = null;
  a.Ca && (a.va != le_F && (c = a.La), a.sa != le_F && (d = a.Fa));
  return null != c && null != d
    ? le_.t(
        "loot_filters.template.affix_condition.x_affixes.with_tier.with_total_tier",
        { count: b, tierCount: c, totalTierCount: d }
      )
    : null != c
    ? le_.t("loot_filters.template.affix_condition.x_affixes.with_tier", {
        count: b,
        tierCount: c,
      })
    : null != d
    ? le_.t("loot_filters.template.affix_condition.x_affixes.with_total_tier", {
        count: b,
        totalTierCount: d,
      })
    : le_.t("loot_filters.template.affix_condition.x_affixes", { count: b });
}
class le_Fe {
  constructor(a, b) {
    this.zc = a;
    this.Gb = b;
    this.Tc = 9;
    this.yd = 16;
    this.Bc = 5;
  }
}
var le_Ge = [3, 2, 5, 1, 4];
function le_He() {
  const a = new le_Ce(
      le_.t("loot_filters.template.groups.idols"),
      15,
      null,
      new le_G([], 1, !1, le_F, 1, le_F, 1)
    ),
    b = new le_Ce(
      le_.t("loot_filters.template.groups.early_campaign"),
      13,
      { min: 0, max: 25 },
      new le_G([], 1, !1, le_F, 1, le_F, 1)
    ),
    c = new le_Ce(
      le_.t("loot_filters.template.groups.mid_campaign"),
      17,
      { min: 0, max: 40 },
      new le_G([], 1, !0, le_E, 3, le_F, 1)
    ),
    d = new le_Ce(
      le_.t("loot_filters.template.groups.early_endgame"),
      3,
      { min: 0, max: 65 },
      new le_G([], 2, !1, le_F, 1, le_F, 1)
    ),
    f = new le_Ce(
      le_.t("loot_filters.template.groups.mid_endgame"),
      5,
      null,
      new le_G([], 2, !0, le_F, 1, le_E, 8)
    ),
    k = new le_Ce(
      le_.t("loot_filters.template.groups.late_endgame"),
      7,
      null,
      new le_G([], 3, !0, le_F, 1, le_E, 10)
    );
  return new le_Fe(a, [b, c, d, f, k]);
}
function le_ze(a, b) {
  return null == a.g || a.g.includes(b.displayCategory) ? !0 : !1;
}
function le_ne(a, b) {
  b = le_Ie(b);
  return null != b ? le_Je(a, b) : !1;
}
function le_Ke(a) {
  null != itemDB.affixList.categoryHeaders
    ? (a.g = itemDB.affixList.categoryHeaders
        .map(function (b) {
          return b.categories;
        })
        .flat())
    : (a.g = null);
}
function le_Le(a, b) {
  const c = [];
  a.forEach(function (d) {
    const f = le_A[d];
    f &&
      f.canRollOn.some(function (k) {
        return b.includes(k);
      }) &&
      c.push(d);
  });
  return c;
}
function le_Ie(a) {
  switch (a) {
    case 0:
      return le_B.Primalist;
    case 1:
      return le_B.Mage;
    case 2:
      return le_B.Sentinel;
    case 3:
      return le_B.Acolyte;
    case 4:
      return le_B.Rogue;
    default:
      return null;
  }
}
function le_Je(a, b) {
  a = a.classSpecificity || le_C.None;
  return (a & le_C.NonSpecific) == le_C.NonSpecific
    ? !0
    : a == le_C.None ||
        (b == le_B.Primalist && (a & le_C.Primalist) == le_C.Primalist) ||
        (b == le_B.Mage && (a & le_C.Mage) == le_C.Mage) ||
        (b == le_B.Sentinel && (a & le_C.Sentinel) == le_C.Sentinel) ||
        (b == le_B.Acolyte && (a & le_C.Acolyte) == le_C.Acolyte) ||
        (b == le_B.Rogue && (a & le_C.Rogue) == le_C.Rogue);
}
function le_Me(a, b) {
  const c = [],
    d = le_Ie(b);
  a.forEach(function (f) {
    const k = le_A[f];
    k && le_Je(k, d) && c.push(f);
  });
  return c;
}
function le_Ne(a, b, c) {
  const d = [],
    f = le_Ie(b);
  a.forEach(function (k) {
    const n = le_A[k];
    if (n) {
      let m = n.canRollOn.some(function (p) {
        return c.includes(p);
      });
      m &&= le_Je(n, f);
      m && d.push(k);
    }
  });
  return d;
}
function le_Oe() {
  const a = [];
  Object.values(le_A).forEach(function (b) {
    1 == b.specialAffixType && le_ze(le_U, b) && a.push(b.affixId);
  });
  return a;
}
function le_Pe() {
  const a = [];
  Object.values(le_A).forEach(function (b) {
    2 == b.specialAffixType && le_ze(le_U, b) && a.push(b.affixId);
  });
  return a;
}
function le_V(a, b, c, d = !0, f = !1, k = null) {
  const n = [];
  Object.values(le_A).forEach(function (m) {
    let p = le_ze(a, m);
    if (p)
      if (1 == m.affixProperties.length) p = !0;
      else if (f) {
        let r = !1;
        m.affixProperties.forEach(function (w) {
          w.property == SP.LevelOfSkills && 1 == w.specialTag && (r = !0);
        });
        p = !r;
      } else p = !1;
    if (p) {
      let r = !1;
      m.affixProperties.forEach(function (w) {
        const z = w.modifierType;
        w.property == b &&
          ((w = w.tags),
          !((d && w == c) || (!d && (w & c) == c)) ||
            (null != k && z != k) ||
            (r = !0));
      });
      r && n.push(m.affixId);
    }
  });
  return n;
}
function le_W(a) {
  return { ea: le_Le(a, $db.lc), kd: le_Le(a, $db.ab) };
}
function le_Qe() {
  var a = le_U;
  a = [
    le_V(a, SP.FireResistance, AT.None),
    le_V(a, SP.ColdResistance, AT.None),
    le_V(a, SP.LightningResistance, AT.None),
    le_V(a, SP.PhysicalResistance, AT.None),
    le_V(a, SP.VoidResistance, AT.None),
    le_V(a, SP.NecroticResistance, AT.None),
    le_V(a, SP.PoisonResistance, AT.None),
    le_V(a, SP.ElementalResistance, AT.None),
    le_V(a, SP.AllResistances, AT.None),
  ].flat();
  return le_W(a);
}
function le_Re() {
  var a = le_U;
  a = [
    le_V(a, SP.Movespeed, AT.None),
    le_V(a, SP.Vitality, AT.None),
    le_V(a, SP.Health, AT.None, !0, !0, 1),
    le_V(a, SP.Endurance, AT.None),
    le_V(a, SP.EnduranceThreshold, AT.None),
    le_V(a, SP.CritAvoidance, AT.None, !1, !0),
    le_V(a, SP.IncreasedCooldownRecoverySpeed, AT.None),
    le_V(a, SP.ReducedBonusDamageTakenFromCrits, AT.None),
    le_V(a, SP.PlayerProperty, 159, !0, !0),
  ].flat();
  return le_W(a);
}
function le_Se() {
  var a = le_U;
  a = [le_V(a, SP.Armour, AT.None), le_V(a, SP.Strength, AT.None)].flat();
  return le_W(a);
}
function le_Te() {
  var a = le_U;
  a = [le_V(a, SP.DodgeRating, AT.None), le_V(a, SP.Dexterity, AT.None)].flat();
  return le_W(a);
}
function le_Ue() {
  var a = le_U;
  a = [
    le_V(a, SP.BlockChance, AT.None),
    le_V(a, SP.BlockEffectiveness, AT.None),
  ].flat();
  return le_W(a);
}
function le_Ve() {
  var a = le_U;
  a = [
    le_V(a, SP.Endurance, AT.None),
    le_V(a, SP.EnduranceThreshold, AT.None),
  ].flat();
  return le_W(a);
}
function le_We() {
  const a = [le_V(le_U, SP.CritAvoidance, AT.None)].flat();
  return le_W(a);
}
function le_Xe() {
  var a = le_U;
  a = [
    le_V(a, SP.WardRetention, AT.None),
    le_V(a, SP.WardRegen, AT.None),
    le_V(a, SP.PotionHealthConvertedToWard, AT.None),
    le_V(a, SP.WardOnPotionUse, AT.None, !0, !0),
    le_V(a, SP.ManaSpentGainedAsWard, AT.None),
    le_V(a, SP.Intelligence, AT.None),
  ].flat();
  return le_W(a);
}
function le_Ye() {
  var a = le_U;
  a = [le_V(a, SP.Health, AT.None), le_V(a, SP.Vitality, AT.None)].flat();
  return le_W(a);
}
function le_Ze() {
  var a = le_U;
  a = [le_V(a, SP.HealthRegen, AT.None), le_V(a, SP.Vitality, AT.None)].flat();
  return le_W(a);
}
function le__e() {
  var a = le_U;
  a = [le_V(a, SP.Mana, AT.None), le_V(a, SP.Attunement, AT.None)].flat();
  return le_W(a);
}
function le_0e() {
  const a = [le_V(le_U, SP.ManaRegen, AT.None)].flat();
  return le_W(a);
}
function le_1e() {
  const a = [le_V(le_U, SP.Movespeed, AT.None)].flat();
  return le_W(a);
}
class le_2e {
  initData() {
    le_Ke(this);
  }
  fd() {
    const a = le_Ie(),
      b = [];
    $.each(le_A, function (c, d) {
      c = d.classSpecificity || le_C.None;
      0 < d.canRollOn.length &&
        c != le_C.None &&
        le_Je(d, a) &&
        !$db.Be(d.canRollOn) &&
        b.push(d.affixId);
    });
    return b;
  }
}
const le_U = new le_2e();
function le_3e(a) {
  let b = "";
  if ((a = a.match(le_4e.m))) {
    const c = a[4];
    b = `${+a[1]}.${+a[2]}.${+a[3]}`;
    c && "x" != c && (a = c.charCodeAt(0) - 97) && (b += "." + a);
  }
  return b;
}
class le_5e {
  constructor() {
    const a = this;
    a.g =
      "HELMET BODY_ARMOR BELT BOOTS GLOVES ONE_HANDED_AXE ONE_HANDED_DAGGER ONE_HANDED_MACES ONE_HANDED_SCEPTRE ONE_HANDED_SWORD WAND ONE_HANDED_FIST TWO_HANDED_AXE TWO_HANDED_MACE TWO_HANDED_SPEAR TWO_HANDED_STAFF TWO_HANDED_SWORD QUIVER SHIELD CATALYST AMULET RING RELIC BOW CROSSBOW IDOL_1x1_ETERRA IDOL_1x1_LAGON IDOL_2x1 IDOL_1x2 IDOL_3x1 IDOL_1x3 IDOL_4x1 IDOL_1x4 IDOL_2x2 BLESSING".split(
        " "
      );
    a.l = ["ONE_HANDED_FIST", "CROSSBOW"];
    a.j =
      "IDOL_1x1_ETERRA IDOL_1x1_LAGON IDOL_2x1 IDOL_1x2 IDOL_3x1 IDOL_1x3 IDOL_4x1 IDOL_1x4 IDOL_2x2 BLESSING".split(
        " "
      );
    a.C = a.g.filter(function (b) {
      return a.j.includes(b) || a.l.includes(b);
    });
    a.i = {};
    a.g.forEach(function (b, c) {
      a.i[b] = c;
    });
    a.m = /^(?:Beta |Version )?(\d+)\.(\d+)\.(\d+)([a-z]?)$/;
    a.B = /^(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?$/;
    a.o = /^(\d+)\.(\d+)\.(\d+)([a-z]?)$/;
  }
}
const le_4e = new le_5e();
function le_6e(a, b) {
  a = new DOMParser().parseFromString(b, "text/xml");
  if (a.getElementsByTagName("parsererror").length) return null;
  try {
    var c = a.firstChild;
    const n = c.getElementsByTagName("name")[0].textContent,
      m = c.getElementsByTagName("description")[0].textContent,
      p = c.getElementsByTagName("filterIcon")[0].textContent,
      r = c.getElementsByTagName("filterIconColor")[0].textContent,
      w = c.getElementsByTagName("lootFilterVersion")[0].textContent;
    var d = c.getElementsByTagName("lastModifiedInVersion")[0].textContent;
    const z = le_7e(c.getElementsByTagName("rules")[0].childNodes);
    {
      c = d;
      d = le_4e;
      const N = c.match(d.B);
      if (N) {
        const C = +N[1],
          G = +N[4];
        let H = `${C}.${+N[2]}.${+N[3]}`;
        G && (H += String.fromCharCode(97 + G));
        var f = 0 == C ? `Beta ${H}` : `Version ${H}`;
      } else {
        var k = c.match(d.o);
        if (k) {
          const C = +k[1],
            G = +k[4];
          let H = `${C}.${+k[2]}.${+k[3]}`;
          G && (H += G);
          f = 0 == C ? `Beta ${H}` : `Version ${H}`;
        } else f = gameVersion;
      }
    }
    const I = new le_Vd();
    I.Na = n;
    I.ec = m;
    I.Wa = `${p},${r}`;
    I.Vc = +w;
    I.Ka = f;
    I.da = z;
    return I;
  } catch (n) {
    console.error(n);
  }
  return null;
}
function le_8e(a, b) {
  const c = new le_9e(),
    d = new FileReader();
  d.onload = function (f) {
    f = le_6e(c, f.target.result);
    null != f ? b.pd(f) : b.od();
  };
  d.onerror = function (f) {
    b.Vd(f.target.error);
  };
  d.readAsText(a);
}
function le_$e(a, b) {
  a = le_6e(new le_9e(), a);
  null != a ? b.pd(a) : b.od();
}
function le_7e(a) {
  const b = [];
  a.forEach(function (c) {
    if (c.tagName && "Rule" == c.tagName) {
      var d = b.push,
        f = c.getElementsByTagName("type")[0].textContent;
      var k = c.getElementsByTagName("color")[0].textContent;
      var n = c.getElementsByTagName("isEnabled")[0].textContent;
      const p = c.getElementsByTagName("levelDependent")[0].textContent,
        r = c.getElementsByTagName("minLvl")[0].textContent,
        w = c.getElementsByTagName("maxLvl")[0].textContent,
        z = c.getElementsByTagName("emphasized")[0].textContent;
      var m = c.getElementsByTagName("nameOverride")[0].textContent;
      c = le_af(c.getElementsByTagName("conditions")[0].childNodes);
      n = "false" == (n || "").toLowerCase();
      m = m ? m : null;
      f = le_bf(f);
      k = new le_N(
        m,
        f,
        +k,
        "true" === (z || "").toLowerCase(),
        "true" === (p || "").toLowerCase() ? { min: +r, max: +w } : null,
        c,
        n
      );
      d.call(b, k);
    }
  });
  b.reverse();
  return b;
}
function le_af(a) {
  const b = [];
  a.forEach(function (c) {
    c.tagName && "Condition" == c.tagName && (c = le_cf(c)) && b.push(c);
  });
  return b;
}
function le_bf(a) {
  switch (a) {
    case "SHOW":
      return le_K;
    case "HIDE":
      return le_L;
    case "HIGHLIGHT":
      return le_M;
    default:
      return console.error(`Unknown rule type (${a})`), le_K;
  }
}
function le_cf(a) {
  var b = a.getAttribute("i:type");
  switch (b) {
    case "SubTypeCondition":
      return le_df(a);
    case "LevelCondition":
      return (
        (b = a.getElementsByTagName("treshold")[0].textContent),
        (a = le_ef(a.getElementsByTagName("type")[0].textContent)),
        (a = null != a ? new le_xd(a, b) : void 0),
        a
      );
    case "RarityCondition":
      return le_ff(a);
    case "ClassCondition":
      return le_gf(a);
    case "AffixCondition":
      return le_hf(a);
    default:
      return console.error(`Unknown condition type (${b})`), null;
  }
}
function le_df(a) {
  const b = [],
    c = [];
  a.getElementsByTagName("type")[0].childNodes.forEach(function (d) {
    if (
      d.tagName &&
      "EquipmentType" == d.tagName &&
      ((d = d.textContent), !le_4e.l.includes(d))
    ) {
      var f = d;
      var k = le_4e;
      "TWO_HANDED_POLEARM" == f && (f = "TWO_HANDED_SPEAR");
      f = k.i[f];
      null != f
        ? b.push(f)
        : console.error(`Unknown / unhandled equipment type (${d})`);
    }
  });
  a.getElementsByTagName("subTypes")[0].childNodes.forEach(function (d) {
    d.tagName && "int" == d.tagName && c.push(+d.textContent);
  });
  return new le_J(b, c);
}
function le_ff(a) {
  const b = [];
  a.getElementsByTagName("rarity")[0]
    .textContent.split(" ")
    .forEach(function (c) {
      c = le_if(c);
      null != c && b.push(c);
    });
  if (0 < b.length) return new le_I(b);
}
function le_gf(a) {
  const b = [];
  a.getElementsByTagName("req")[0]
    .textContent.split(" ")
    .forEach(function (c) {
      c = le_jf(c);
      null != c && b.push(c);
    });
  return new le_H(b);
}
function le_hf(a) {
  const b = [];
  a.getElementsByTagName("affixes")[0].childNodes.forEach(function (m) {
    if (m.tagName && "int" == m.tagName) {
      m = +m.textContent;
      const p = le_A[m];
      p && 0 < p.canRollOn.length && b.push(m);
    }
  });
  const c = a.getElementsByTagName("minOnTheSameItem")[0].textContent,
    d = a.getElementsByTagName("comparsionValue")[0].textContent;
  var f = a.getElementsByTagName("combinedComparsion")[0].textContent;
  const k = a.getElementsByTagName("combinedComparsionValue")[0].textContent,
    n =
      "true" ==
      (a.getElementsByTagName("advanced")[0].textContent || "").toLowerCase();
  a = le_kf(a.getElementsByTagName("comparsion")[0].textContent);
  f = le_kf(f);
  return new le_G(b, +c, n, a, +d, f, +k);
}
function le_ef(a) {
  switch (a) {
    case "BELOW_LEVEL":
      return le_yd;
    case "ABOVE_LEVEL":
      return le_Ad;
    case "MAX_LVL_BELOW_CHARACTER_LEVEL":
      return le_Bd;
    case "HIGHEST_USABLE_LEVEL":
      return le_Cd;
    default:
      return console.error(`Unknown level type (${a})`), null;
  }
}
function le_if(a) {
  switch (a) {
    case "NORMAL":
      return le_O;
    case "MAGIC":
      return le_P;
    case "RARE":
      return le_Q;
    case "UNIQUE":
      return le_0d;
    case "SET":
      return le_1d;
    case "EXALTED":
      return le_R;
    default:
      return console.error(`Unknown rarity type (${a})`), null;
  }
}
function le_jf(a) {
  switch (a) {
    case "Primalist":
      return le_B.Primalist;
    case "Mage":
      return le_B.Mage;
    case "Sentinel":
      return le_B.Sentinel;
    case "Acolyte":
      return le_B.Acolyte;
    case "Rogue":
      return le_B.Rogue;
    default:
      return console.error(`Unknown class type (${a})`), null;
  }
}
function le_kf(a) {
  switch (a) {
    case "ANY":
      return le_F;
    case "EQUAL":
      return le_od;
    case "LESS":
      return le_pd;
    case "LESS_OR_EQUAL":
      return le_qd;
    case "MORE":
      return le_rd;
    case "MORE_OR_EQUAL":
      return le_E;
    default:
      return console.error(`Unknown comparison type (${a})`), le_F;
  }
}
class le_9e {}
function le_lf(a) {
  const b =
      null == a.xa
        ? "<nameOverride />"
        : `<nameOverride>${le_mf(a.xa)}</nameOverride>`,
    c = [];
  a.qa.forEach(function (k) {
    (k = le_nf(k)) && c.push(k);
  });
  const d = le_of(a.ma),
    f = a.Z;
  return `
    <Rule>
      <type>${d}</type>
      <conditions>
${c.join("\n")}
      </conditions>
      <color>${a.Da}</color>
      <isEnabled>${a.Va ? "false" : "true"}</isEnabled>
      <levelDependent>${null == f ? "false" : "true"}</levelDependent>
      <minLvl>${null == f ? 0 : f.min}</minLvl>
      <maxLvl>${null == f ? 0 : f.max}</maxLvl>
      <emphasized>${a.Ga ? "true" : "false"}</emphasized>
      ${b}
    </Rule>`.replace(/^\n/, "");
}
function le_mf(a) {
  return a.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
}
function le_nf(a) {
  if (a instanceof le_J) return le_pf(a);
  if (a instanceof le_xd) {
    const b = a.Xa;
    a = le_qf(a.Ya);
    return `
        <Condition i:type="LevelCondition">
          <treshold>${b}</treshold>
          <type>${a}</type>
        </Condition>`.replace(/^\n/, "");
  }
  if (a instanceof le_I) return le_rf(a);
  if (a instanceof le_H) return le_sf(a);
  if (a instanceof le_G) return le_tf(a);
  console.error("Unknown condition type", a);
  return null;
}
function le_of(a) {
  switch (a) {
    case le_K:
      return "SHOW";
    case le_L:
      return "HIDE";
    case le_M:
      return "HIGHLIGHT";
    default:
      return console.error("Unknown rule type", a), "SHOW";
  }
}
function le_pf(a) {
  var b = a.ra;
  if (0 == b.length) b = "<type />";
  else {
    const c = [];
    b.forEach(function (d) {
      d = le_4e.g[d];
      null != d &&
        c.push(
          `
            <EquipmentType>${d}</EquipmentType>`.replace(/^\n/, "")
        );
    });
    b = `<type>
${c.join("\n")}
          </type>`;
  }
  a = a.Ea;
  if (0 == a.length) a = "<subTypes />";
  else {
    const c = [];
    a.forEach(function (d) {
      c.push(
        `
            <int>${d}</int>`.replace(/^\n/, "")
      );
    });
    a = `<subTypes>
${c.join("\n")}
          </subTypes>`;
  }
  return `
        <Condition i:type="SubTypeCondition">
          ${b}
          ${a}
        </Condition>`.replace(/^\n/, "");
}
function le_rf(a) {
  const b = [];
  a.Ma.forEach(function (c) {
    c = le_uf(c);
    null != c && b.push(c);
  });
  return `
        <Condition i:type="RarityCondition">
          ${0 == b.length ? "<rarity />" : `<rarity>${b.join(" ")}</rarity>`}
        </Condition>`.replace(/^\n/, "");
}
function le_sf(a) {
  const b = [];
  a.ua.forEach(function (c) {
    c = le_vf(c);
    null != c && b.push(c);
  });
  return `
        <Condition i:type="ClassCondition">
          ${0 == b.length ? "<req />" : `<req>${b.join(" ")}</req>`}
        </Condition>`.replace(/^\n/, "");
}
function le_tf(a) {
  var b = a.pa;
  if (0 == b.length) b = "<affixes />";
  else {
    const n = [];
    b.forEach(function (m) {
      n.push(
        `
            <int>${m}</int>`.replace(/^\n/, "")
      );
    });
    b = `<affixes>
${n.join("\n")}
          </affixes>`;
  }
  const c = a.wa,
    d = le_wf(a.va),
    f = a.La,
    k = le_wf(a.sa);
  return `
        <Condition i:type="AffixCondition">
          ${b}
          <comparsion>${d}</comparsion>
          <comparsionValue>${f}</comparsionValue>
          <minOnTheSameItem>${c}</minOnTheSameItem>
          <combinedComparsion>${k}</combinedComparsion>
          <combinedComparsionValue>${a.Fa}</combinedComparsionValue>
          <advanced>${a.Ca ? "true" : "false"}</advanced>
        </Condition>`.replace(/^\n/, "");
}
function le_qf(a) {
  switch (a) {
    case le_yd:
      return "BELOW_LEVEL";
    case le_Ad:
      return "ABOVE_LEVEL";
    case le_Bd:
      return "MAX_LVL_BELOW_CHARACTER_LEVEL";
    case le_Cd:
      return "HIGHEST_USABLE_LEVEL";
    default:
      return console.error("Unknown level type", a), null;
  }
}
function le_uf(a) {
  switch (a) {
    case le_O:
      return "NORMAL";
    case le_P:
      return "MAGIC";
    case le_Q:
      return "RARE";
    case le_0d:
      return "UNIQUE";
    case le_1d:
      return "SET";
    case le_R:
      return "EXALTED";
    default:
      return console.error("Unknown rarity type", a), null;
  }
}
function le_vf(a) {
  switch (a) {
    case le_B.Primalist:
      return "Primalist";
    case le_B.Mage:
      return "Mage";
    case le_B.Sentinel:
      return "Sentinel";
    case le_B.Acolyte:
      return "Acolyte";
    case le_B.Rogue:
      return "Rogue";
    default:
      return console.error("Unknown class type", a), null;
  }
}
function le_wf(a) {
  switch (a) {
    case le_F:
      return "ANY";
    case le_od:
      return "EQUAL";
    case le_pd:
      return "LESS";
    case le_qd:
      return "LESS_OR_EQUAL";
    case le_rd:
      return "MORE";
    case le_E:
      return "MORE_OR_EQUAL";
    default:
      return console.error("Unknown comparison type", a), "ANY";
  }
}
class le_xf {
  nc(a) {
    const b = [];
    a.da.forEach(function (n) {
      (n = le_lf(n)) && b.push(n);
    });
    b.reverse();
    const c = a.Na,
      d = a.aa() || "",
      f = a.Wa.split(","),
      k = a.Vc;
    a = le_3e(a.Ka);
    return `
<ItemFilter xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <name>${le_mf(c)}</name>
  <filterIcon>${f[0]}</filterIcon>
  <filterIconColor>${f[1]}</filterIconColor>
  <description>${le_mf(d)}</description>
  <lastModifiedInVersion>${a}</lastModifiedInVersion>
  <lootFilterVersion>${k}</lootFilterVersion>
  <rules>
${b.join("\n")}
  </rules>
</ItemFilter>`.replace(/^\n/, "");
  }
}
function le_yf(a) {
  return (JSON.parse(a) || []).map(function (b) {
    return le_zf(b);
  });
}
function le_zf(a) {
  const b = a[4],
    c = !!a[6];
  return new le_N(
    a[0],
    a[1],
    a[2],
    !!a[3],
    null == b ? null : { min: b[0], max: b[1] },
    a[5].map(function (d) {
      return le_Af(d);
    }),
    c
  );
}
function le_Af(a) {
  const b = a[0];
  a = a[1];
  switch (b) {
    case le_md:
      return new le_ld();
    case le_ud:
      return new le_G(a[0], a[1], !!a[2], a[3], a[4], a[5], a[6]);
    case le_Hd:
      return new le_J(a[0], a[1]);
    case le_zd:
      return new le_xd(a[0], a[1]);
    case le_Ed:
      return new le_I(a[0]);
    case le_wd:
      return new le_H(a[0]);
    default:
      return console.error(`Unknown condition type (${b})`), null;
  }
}
class le_Bf {
  parse(a) {
    const b = le_yf(a.rules);
    return new le_Vd(
      a.id,
      a.title,
      a.description,
      a.icon,
      b,
      a.version,
      a.createdDate,
      a.updatedDate,
      a.gameVersion,
      a.authorId,
      a.classes,
      a.skills,
      a.tags,
      a.privacy,
      a.source,
      a.originalId
    );
  }
}
function le_Cf(a) {
  a = a.map(function (b) {
    return le_Df(b);
  });
  return JSON.stringify(a);
}
function le_Df(a) {
  const b = a.Z;
  return [
    a.xa,
    a.ma,
    a.Da,
    a.Ga ? 1 : 0,
    null == b ? null : [b.min, b.max],
    a.qa.map(function (c) {
      return c.yb();
    }),
    a.Va ? 1 : 0,
  ];
}
class le_Ef {
  nc(a) {
    return {
      id: a.Sc,
      title: a.Na,
      description: a.aa(),
      icon: a.Wa,
      rules: le_Cf(a.da),
      version: a.Vc,
      createdDate: a.vd,
      updatedDate: a.zd,
      gameVersion: a.Ka,
      authorId: a.Rc,
      classes: a.Fb,
      skills: a.Hb,
      tags: a.getTags(),
      privacy: a.Ac,
      source: a.Uc,
      originalId: a.je,
      gameVersionBase: a.Ka.replace(/[^\d]+$/, ""),
    };
  }
}
function le_Ff(a) {
  return a.data.skillTrees.map(function (b) {
    return b.treeID;
  });
}
function le_Gf(a, b) {
  const c = le_Hf(a, b ? b.ld : !1);
  a = $db.lc.filter(function (d) {
    return !c.includes(d);
  });
  return new le_N(
    le_.t("loot_filters.generator.rules.not_used_item_types"),
    le_L,
    0,
    !1,
    null,
    [new le_J(a, [])],
    !1
  );
}
function le_If(a) {
  const b = a["class"];
  a = [
    le_B.Primalist,
    le_B.Mage,
    le_B.Sentinel,
    le_B.Acolyte,
    le_B.Rogue,
  ].filter(function (c, d) {
    return d != b;
  });
  return new le_N(null, le_L, 0, !1, null, [new le_H(a)], !1);
}
function le_Jf(a, b, c) {
  const d = c ? c.ya : [];
  c = c ? c.ld : !1;
  const f = Object.values(a.data.idols);
  a = le_Kf(a, f, !c, d);
  const k = [];
  Object.entries(a).forEach(function (n) {
    const [m, p] = n;
    n = new le_J([+m], p.Yc || p.jb);
    const r = le_De(b.zc, p.H);
    k.push(new le_N(null, le_M, r.color, !1, r.Jb, [n, r.$a], !1));
  });
  return k;
}
function le_Lf(a, b) {
  let c = [36].concat();
  c = le_Me(c, a["class"]);
  const d = [];
  le_Ff(a).forEach(function (f) {
    (f = LEAbilities.abilityList[f]) && d.push(f.index);
  });
  Object.entries(le_A).forEach(function (f) {
    const [, k] = f;
    le_ze(le_U, k) &&
      k.affixProperties.forEach(function (n) {
        n.property == SP.LevelOfSkills &&
          1 == n.specialTag &&
          d.includes(n.tags) &&
          c.push(k.affixId);
      });
  });
  return new le_N(
    le_.t("loot_filters.generator.rules.items_with_high_value_affixes"),
    le_M,
    b.Tc,
    !1,
    null,
    [new le_G(c, 1, !1, le_F, 1, le_F, 1)],
    !1
  );
}
function le_Mf(a, b, c) {
  const d = c ? c.af : !1;
  var f = c ? c.ya : [];
  c = c ? c.ld : !1;
  const k = Object.values(a.data.equipment);
  a = le_Kf(a, k, !c, f);
  const n = [];
  f = b.Gb.length;
  for (let m = f - 1; 0 <= m; m--)
    Object.entries(a).forEach(function (p) {
      const [r, w] = p;
      p = new le_J([+r], d ? w.jb : w.Yc || w.jb);
      const z = le_De(b.Gb[m], w.H);
      n.push(new le_N(null, le_M, z.color, !1, z.Jb, [p, z.$a], !1));
    });
  return n;
}
function le_Hf(a, b) {
  const c = [];
  Object.values(a.data.equipment).forEach(function (d) {
    if ((d = d.id && $db.getItemById(d.id))) {
      const f = d.baseTypeId;
      (b && null != d.uniqueId) || c.includes(f) || c.push(f);
    }
  });
  return c;
}
function le_Kf(a, b, c, d) {
  b = le_Nf(a, b, c, d);
  const f = a["class"];
  Object.entries(b).forEach(function (k) {
    const [n, m] = k;
    k = le_Of(+n, f).map(function (p) {
      return p.subTypeId;
    });
    m.Yc = k;
  });
  return b;
}
function le_Nf(a, b, c, d) {
  const f = {};
  let k = [];
  b.forEach(function (n) {
    var m = n.id && $db.getItemById(n.id);
    if (m && null == m.uniqueId) {
      const p = m.baseTypeId;
      let r = f[p];
      null == r && ((r = new le_Pf()), (f[p] = r));
      le_Qf(r, m.subTypeId);
      m = [].concat(n.affixes);
      n.sealedAffix && m.push(n.sealedAffix);
      m.forEach(function (w) {
        w = w.id;
        var z = le_t[w] || le_u[w];
        z && ((w = r), (z = z.affixId), w.H.includes(z) || w.H.push(z));
      });
      k = k.concat(r.H);
    }
  });
  if (c) {
    b = le_Rf(b);
    const n = a["class"];
    b.forEach(function (m) {
      let p = f[m];
      null == p && ((p = new le_Pf()), (f[m] = p));
      const r = le_Of(m, n),
        w = r.map(function (z) {
          return z.subTypeId;
        });
      p.jb = w;
      m = le_Sf(m, n, r, k);
      p.H = m;
    });
  }
  0 < d.length &&
    Object.entries(f).forEach(function (n) {
      const [m, p] = n;
      d.forEach(function (r) {
        const w = le_A[r];
        w && w.canRollOn.includes(+m) && (p.H.includes(r) || p.H.push(r));
      });
    });
  return f;
}
function le_Of(a, b) {
  const c = [];
  Object.entries(itemDB.itemList.equippable[a].subItems).forEach(function (d) {
    [, d] = d;
    !$db.itemClassReqMet(d, b) ||
      (34 != d.baseTypeId && !$db.Sd(d) && d.cannotDrop) ||
      c.push(d);
  });
  return c;
}
function le_Rf(a) {
  const b = {};
  a.forEach(function (d) {
    if ((d = d.id && $db.getItemById(d.id))) {
      const f = d.baseTypeId;
      let k = b[f];
      null == k && ((k = []), (b[f] = k));
      k.push(null != d.uniqueId ? 1 : 0);
    }
  });
  const c = [];
  Object.entries(b).forEach(function (d) {
    const [f, k] = d;
    let n = 0;
    k.forEach(function (m) {
      n += m;
    });
    0 < n && n == k.length && !c.includes(f) && c.push(+f);
  });
  return c;
}
function le_Sf(a, b, c, d) {
  let f = [];
  c.forEach(function (k) {
    const n = [];
    d.forEach(function (m) {
      const p = le_A[m];
      p &&
        !n.includes(m) &&
        p.canRollOn.includes(a) &&
        $db.affixClassReqMet(k, p, b) &&
        n.push(m);
    });
    f = f.concat(n);
    d = d.filter(function (m) {
      return !n.includes(m);
    });
  });
  return f;
}
class le_Tf {
  constructor() {
    this.F = `${window.location.protocol}//${window.location.host}/planner`;
  }
  ed(a, b, c, d) {
    a = `${this.F}/${a}`;
    const f = `${le_Ge[b["class"]]},${12}`;
    var k = d ? d.pb : null;
    k ||= le_He();
    var n = new le_N(null, le_K, 0, !1, null, [new le_I([le_0d, le_1d])], !1);
    var m = new le_N(null, le_K, 0, !1, null, [new le_I([le_R])], !1),
      p = le_Oe();
    p = [
      ...(0 == p.length
        ? []
        : [
            new le_N(
              le_.t("loot_filters.generator.rules.experimental_items"),
              le_K,
              0,
              !1,
              null,
              [new le_G(p, 1, !1, le_F, 1, le_F, 1)],
              !1
            ),
          ]),
    ];
    var r = le_Pe();
    r = [
      ...(0 == r.length
        ? []
        : [
            new le_N(
              le_.t("loot_filters.generator.rules.personal_items"),
              le_K,
              0,
              !1,
              null,
              [new le_G(r, 1, !1, le_F, 1, le_F, 1)],
              !0
            ),
          ]),
    ];
    var w = k;
    w = new le_N(
      le_.t("loot_filters.generator.rules.items_for_shattering"),
      le_M,
      w.yd,
      !1,
      null,
      [new le_G($db.fd(), 1, !0, le_E, 5, le_F, 1)],
      !0
    );
    var z = le_Gf(b, d),
      I = le_If(b),
      N = [...le_Jf(b, k, d)],
      C = k;
    const G = b["class"];
    var H = [].concat(le_Ye().kd, le_Qe().kd);
    H = le_Me(H, G);
    C = le_De(C.zc, []);
    H = new le_N(
      le_.t("loot_filters.generator.rules.idols_with_valuable_affixes"),
      le_M,
      C.color,
      !1,
      null,
      [new le_J($db.ab.slice(), []), new le_G(H, 1, !1, le_F, 1, le_F, 1)],
      !1
    );
    C = le_Lf(b, k);
    d = [...le_Mf(b, k, d)];
    k = new le_N(
      le_.t("loot_filters.generator.rules.items_until_char_level", {
        value: k.Bc,
      }),
      le_K,
      0,
      !1,
      { min: 0, max: k.Bc },
      [new le_I([le_O, le_P, le_Q])],
      !1
    );
    n = [
      n,
      m,
      ...p,
      ...r,
      w,
      z,
      I,
      ...N,
      H,
      C,
      ...d,
      k,
      new le_N(null, le_L, 0, !1, null, [new le_I([le_O, le_P, le_Q])], !1),
    ];
    p = b["class"];
    d = b.mastery;
    m = [];
    0 != d && m.push(`${p}-0`);
    m.push(`${p}-${d}`);
    p = le_Ff(b);
    return new le_Vd(
      null,
      c,
      a,
      f,
      n,
      1,
      Date.now(),
      Date.now(),
      b.created_for_build || gameVersion,
      myUserId,
      m,
      p,
      [],
      0,
      5,
      null
    );
  }
}
function le_Qf(a, b) {
  a.jb.includes(b) || a.jb.push(b);
}
class le_Pf {
  constructor() {
    this.Yc = null;
    this.jb = [];
    this.H = [];
  }
}
function le_Uf(a) {
  const b = le_Vf(a);
  a = $db.lc.filter(function (c) {
    return !b.includes(c);
  });
  return new le_N(
    le_.t("loot_filters.generator.rules.not_used_item_types"),
    le_L,
    0,
    !1,
    null,
    [new le_J(a, [])],
    !1
  );
}
function le_Wf(a) {
  const b = [
    le_B.Primalist,
    le_B.Mage,
    le_B.Sentinel,
    le_B.Acolyte,
    le_B.Rogue,
  ].filter(function (c, d) {
    return d != a;
  });
  return new le_N(null, le_L, 0, !1, null, [new le_H(b)], !1);
}
function le_Xf(a, b, c) {
  let d = [36].concat();
  d = le_Me(d, a);
  const f = [];
  b.forEach(function (k) {
    (k = LEAbilities.abilityList[k]) && f.push(k.index);
  });
  Object.entries(le_A).forEach(function (k) {
    const [, n] = k;
    le_ze(le_U, n) &&
      n.affixProperties.forEach(function (m) {
        m.property == SP.LevelOfSkills &&
          1 == m.specialTag &&
          f.includes(m.tags) &&
          d.push(n.affixId);
      });
  });
  b.forEach(function (k) {
    (k = itemSkillSources[k]) &&
      k.forEach(function (n) {
        (n = le_t[n] || le_u[n]) && d.push(n.affixId);
      });
  });
  return new le_N(
    le_.t("loot_filters.generator.rules.items_with_high_value_affixes"),
    le_M,
    c.Tc,
    !1,
    null,
    [new le_G(d, 1, !1, le_F, 1, le_F, 1)],
    !1
  );
}
function le_Yf(a, b, c) {
  const d = [];
  Object.values(a).forEach(function (k) {
    const n = le_Le(b, k.types);
    d.push({ ff: k.types, jb: k.Rb, H: n });
  });
  const f = [];
  a = c.Gb.length;
  for (let k = a - 1; 0 <= k; k--)
    d.forEach(function (n) {
      const m = new le_J(n.ff, n.jb);
      n = le_De(c.Gb[k], n.H);
      f.push(new le_N(null, le_M, n.color, !1, n.Jb, [m, n.$a], !1));
    });
  return f;
}
function le_Vf(a) {
  const b = [];
  Object.values(a).forEach(function (c) {
    c.types.forEach(function (d) {
      b.includes(d) || b.push(d);
    });
  });
  return b;
}
class le_Zf {
  ed(a) {
    const b = a.title,
      c = a.ha,
      d = a.Ob,
      f = a.tb,
      k = `${le_Ge[c]},${12}`;
    var n = a ? a.pb : null;
    n ||= le_He();
    var m = new le_N(null, le_K, 0, !1, null, [new le_I([le_0d, le_1d])], !1);
    var p = new le_N(null, le_K, 0, !1, null, [new le_I([le_R])], !1),
      r = le_Oe();
    r = [
      ...(0 == r.length
        ? []
        : [
            new le_N(
              le_.t("loot_filters.generator.rules.experimental_items"),
              le_K,
              0,
              !1,
              null,
              [new le_G(r, 1, !1, le_F, 1, le_F, 1)],
              !1
            ),
          ]),
    ];
    var w = le_Pe();
    w = [
      ...(0 == w.length
        ? []
        : [
            new le_N(
              le_.t("loot_filters.generator.rules.personal_items"),
              le_K,
              0,
              !1,
              null,
              [new le_G(w, 1, !1, le_F, 1, le_F, 1)],
              !0
            ),
          ]),
    ];
    var z = n;
    z = new le_N(
      le_.t("loot_filters.generator.rules.items_for_shattering"),
      le_M,
      z.yd,
      !1,
      null,
      [new le_G($db.fd(), 1, !0, le_E, 5, le_F, 1)],
      !0
    );
    var I = le_Uf(a.ea),
      N = le_Wf(a.ha),
      C = a.H[le_X],
      G = n;
    var H = new le_J($db.ab.slice(), []);
    C = le_De(G.zc, C);
    H = new le_N(null, le_M, C.color, !1, C.Jb, [H, C.$a], !1);
    C = le_Xf(a.ha, a.tb, n);
    a = [...le_Yf(a.ea, a.H[le_Y], n)];
    n = new le_N(
      le_.t("loot_filters.generator.rules.items_until_char_level", {
        value: n.Bc,
      }),
      le_K,
      0,
      !1,
      { min: 0, max: n.Bc },
      [new le_I([le_O, le_P, le_Q])],
      !1
    );
    m = [
      m,
      p,
      ...r,
      ...w,
      z,
      I,
      N,
      H,
      C,
      ...a,
      n,
      new le_N(null, le_L, 0, !1, null, [new le_I([le_O, le_P, le_Q])], !1),
    ];
    p = [];
    0 != d && p.push(`${c}-0`);
    p.push(`${c}-${d}`);
    return new le_Vd(
      null,
      b,
      "Generated by LE Tools Filter Wizard",
      k,
      m,
      1,
      Date.now(),
      Date.now(),
      gameVersion,
      myUserId,
      p,
      f,
      [],
      0,
      3,
      null
    );
  }
}
function le__f(a, b, c) {
  $.ajax({
    url: "/loot-filters/add_loot_filter.php",
    type: "POST",
    headers: { "X-Requested-With": "XMLHttpRequest" },
    data: { data: JSON.stringify(a) },
    success: function (d) {
      d.error ? (alert(d.error), c()) : d.entry && b(d.entry);
    },
    error: function () {
      alert(le_.t("loot_filters.errors.unable_to_save_filter"));
      c();
    },
  });
}
function le_0f(a, b, c) {
  $.ajax({
    url: "/loot-filters/update_loot_filter.php",
    type: "POST",
    headers: { "X-Requested-With": "XMLHttpRequest" },
    data: { data: JSON.stringify(a) },
    success: function (d) {
      d.error ? (alert(d.error), c()) : b(d.entry);
    },
    error: function () {
      alert(le_.t("loot_filters.errors.unable_to_update_filter"));
      c();
    },
  });
}
function le_1f(a, b, c) {
  $.ajax({
    url: "/loot-filters/delete_loot_filter.php",
    type: "POST",
    headers: { "X-Requested-With": "XMLHttpRequest" },
    data: { id: a },
    success: function (d) {
      d.error ? (alert(d.error), c()) : b();
    },
    error: function () {
      alert(le_.t("loot_filters.errors.unable_to_delete_filter"));
      c();
    },
  });
}
function le_2f(a, b, c) {
  $.ajax({
    url: "/loot-filters/duplicate_loot_filter.php",
    type: "POST",
    headers: { "X-Requested-With": "XMLHttpRequest" },
    data: { id: a },
    success: function (d) {
      d.error ? (alert(d.error), c()) : b(d.entry);
    },
    error: function () {
      alert(le_.t("loot_filters.errors.unable_to_duplicate_filter"));
      c();
    },
  });
}
function le_3f(a, b, c) {
  $.ajax({
    url: "/loot-filters/load_loot_filter.php",
    type: "POST",
    headers: { "X-Requested-With": "XMLHttpRequest" },
    data: { id: a },
    success: function (d) {
      d.error ? (console.error(d.error), c()) : b(d.entry);
    },
    error: function () {
      c();
    },
  });
}
function le_4f(a, b) {
  var c = {
      "ok": true,
      "lootFilters": [
          {
              "id": "aBZjJDB4",
              "title": "empty",
              "description": "",
              "icon": "0,0",
              "rules": "[]",
              "version": 1,
              "createdDate": "2024-03-15 18:48:42",
              "updatedDate": "2024-03-15 18:48:42",
              "gameVersion": "Version 1.0.3",
              "authorId": 31636,
              "classes": [],
              "skills": [],
              "tags": [],
              "privacy": 0,
              "source": 0,
              "originalId": "",
              "gameVersionBase": "Version 1.0.3"
          },
      ],
      "lootFilterTemplates": []
  }
  a(c);

  // D2Core: Remove ajax
  // $.ajax({
  //   url: "/loot-filters/get_user_data.php",
  //   type: "POST",
  //   headers: { "X-Requested-With": "XMLHttpRequest" },
  //   success: function (c) {
  //     c.error ? (alert(c.error), b()) : a(c);
  //   },
  //   error: function () {
  //     alert(le_.t("loot_filters.errors.unable_to_load_user_loot_filters"));
  //     b();
  //   },
  // });
}
function le_5f(a, b, c) {
  $.ajax({
    url: "/load_build.php?id=" + encodeURIComponent(a),
    type: "POST",
    headers: { "X-Requested-With": "XMLHttpRequest" },
    data: { token: "-" },
    success: function (d) {
      d.error ? (alert(d.error), c()) : b(d);
    },
    error: function () {
      alert(le_.t("loot_filters.errors.unable_to_load_build_data"));
      c();
    },
  });
}
function le_6f(a) {
  a.m.click(function (b) {
    le_7f(b) && (b.preventDefault(), le_Z("/shared/"));
  });
  a.o.click(function (b) {
    le_7f(b) && (b.preventDefault(), le_Z("/my/"));
  });
}
function le_8f(a) {
  a.j = new le_9f({
    Se: function (b) {
      le__ = le_$f = "/my";
      le_ag(a);
      a.C.Ra[b.id] = b;
      userLootFilters.push(b);
      2 == b.privacy && sharedLootFilters.push(b);
      le_Z(`/view/${b.id}`);
    },
  });
  isLoggedIn || (a.j.locked = !0);
  $(".header-info-wrapper .add-filter-link").click(function (b) {
    b.preventDefault();
    (a.i.hasClass("with-viewer") && !le_bg(a.l)) || a.j.show();
  });
}
function le_ag(a) {
  le__
    ? (a.m.removeClass("selected"), a.o.addClass("selected"))
    : (a.m.addClass("selected"), a.o.removeClass("selected"));
}
function le_cg(a, b, c) {
  var d = le_0;
  d.i.removeClass("with-viewer");
  d.i.addClass("with-list");
  d = d.g;
  d.A = a ? sharedLootFilters : userLootFilters;
  d.j = b;
  le_dg(d, b);
  b = $(".entry-list-filter .search-block");
  a = b.find("input");
  b = b.find(".search-clear");
  a.val("");
  b.hide();
  d.o = "";
  le_eg(d, d.A);
  isLoggedIn || "" == le__
    ? le_fg(d, c)
    : ((c = $(".entry-list")),
      le_gg(d),
      c.empty(),
      c.find(".pagination-wrapper").remove(),
      le_hg(d, []),
      (d = le_
        .t("loot_filters.errors.not_logged_in")
        .replace(/<a>([^<]+)<\/a>/i, '<a href="/forum/login">$1</a>')),
      $(`<div class="my-list-not-allowed">
    			<div>${d}</div>
			</div>`).appendTo(c));
}
class le_ig {
  constructor() {
    this.C = le_jg;
    this.l = new le_kg(this.C);
    this.g = new le_lg();
  }
  initData() {
    $db.init();
    le_U.initData();
    le_ie.initData();
    le_pe.initData();
    this.g.initData();
  }
  V() {
    this.i = $(".content-view-wrapper");
    this.m = $(".header-info-wrapper .shared-loot-filters-link");
    this.o = $(".header-info-wrapper .user-loot-filters-link");
    le_da();
    this.g.V();
    le_6f(this);
    le_8f(this);
    this.P();
  }
  sd(a) {
    return this.g.sd(a);
  }
  Ic(a) {
    return this.g.Ic(a);
  }
  P() {
    $(".header-info-wrapper .shared-loot-filters-link > span").text(
      le_.t("loot_filters.groups.shared")
    );
    $(".header-info-wrapper .user-loot-filters-link > span").text(
      le_.t("loot_filters.groups.my")
    );
    $(".header-info-wrapper .add-filter-link > span").html(
      le_.t("loot_filters.create_filter_button")
    );
    this.l.P();
    this.g.P();
    this.j && this.j.P();
  }
}
function le_mg(a, b) {
  a.on("input", function () {
    const c = Math.min(parseInt(this.max), parseInt(this.value) || 0);
    this.value = c;
    b(c);
  });
}
function le_ng(a, b, c, d, f, k) {
  k = k || {};
  const n = null != k.rd ? k.rd : !1;
  k = null != k.Pc ? k.Pc : null;
  const m = $(
    '<select data-placeholder="' +
      d +
      '" class="mod-select"' +
      (c ? " multiple" : "") +
      "></select>"
  ).appendTo(a);
  a = { allowClear: !1, minimumResultsForSearch: -1 };
  n &&
    (a.templateResult = function (p, r) {
      p.element && $(r).addClass($(p.element).attr("class"));
      return p.text;
    });
  c && null != k && (a.maximumSelectionLength = k);
  m.select2(a).change(function (p) {
    p = (p = $(p.currentTarget).val()) || null;
    le_1(m, p, !1);
    f(p);
  });
  le_og(m, b);
}
function le_2(a, b, c, d) {
  le_ng(a, b, !1, "", c, d);
}
function le_3(a, b, c, d, f) {
  le_ng(a, b, !0, c, d, f);
}
function le_1(a, b, c) {
  null == b || ($.isArray(b) && 0 == b.length)
    ? a.removeClass("selected")
    : a.addClass("selected");
  c && a.val(b).trigger("change.select2");
}
function le_og(a, b) {
  1 == b.length ? a.prop("disabled", "disabled") : a.prop("disabled", !1);
  a.html(b.join(""));
}
function le_4(a, b) {
  const c = a.find(".checkbox");
  b
    ? (a.addClass("selected"),
      c.html(
        '<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="16" height="16" viewBox="0 0 24 24"><path d="M 5 3 C 3.897 3 3 3.897 3 5 L 3 19 C 3 20.103 3.897 21 5 21 L 19 21 C 20.103 21 21 20.103 21 19 L 21 9.2421875 L 19 11.242188 L 19.001953 19 L 5 19 L 5 5 L 16.757812 5 L 18.757812 3 L 5 3 z M 21.292969 3.2929688 L 11 13.585938 L 7.7070312 10.292969 L 6.2929688 11.707031 L 11 16.414062 L 22.707031 4.7070312 L 21.292969 3.2929688 z"></path></svg>'
      ))
    : (a.removeClass("selected"),
      c.html(
        '<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="16" height="16" viewBox="0 0 24 24"><path d="M 5 3 C 4.4777778 3 3.9453899 3.1913289 3.5683594 3.5683594 C 3.1913289 3.9453899 3 4.4777778 3 5 L 3 19 C 3 19.522222 3.1913289 20.05461 3.5683594 20.431641 C 3.9453899 20.808671 4.4777778 21 5 21 L 19 21 C 19.522222 21 20.05461 20.808671 20.431641 20.431641 C 20.808671 20.05461 21 19.522222 21 19 L 21 5 C 21 4.4777778 20.808671 3.9453899 20.431641 3.5683594 C 20.05461 3.1913289 19.522222 3 19 3 L 5 3 z M 5 5 L 19 5 L 19 19 L 5 19 L 5 5 z"></path></svg>'
      ));
}
function le_pg(a) {
  const b = a.find(".checkbox");
  a.addClass("selected");
  b.html(
    '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" style="width:16px;height:16px;"><path d="M280-440h360v-80H320v80Zm-80 320q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"></path></svg>'
  );
}
function le_5(a, b, c = null) {
  return (
    '<option value="' +
    a +
    '"' +
    (c && c.disabled ? " disabled" : "") +
    (c && c.Kb ? ' class="' + c.Kb + '"' : "") +
    ">" +
    b +
    "</option>"
  );
}
function le_qg() {
  return '<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M480-240q20 0 34-14t14-34q0-20-14-34t-34-14q-20 0-34 14t-14 34q0 20 14 34t34 14Zm-36-153h73q0-37 6.5-52.5T555-485q35-34 48.5-58t13.5-53q0-55-37.5-89.5T484-720q-51 0-88.5 27T343-620l65 27q9-28 28.5-43.5T482-652q28 0 46 16t18 42q0 23-15.5 41T496-518q-35 32-43.5 52.5T444-393Zm36 297q-79 0-149-30t-122.5-82.5Q156-261 126-331T96-480q0-80 30-149.5t82.5-122Q261-804 331-834t149-30q80 0 149.5 30t122 82.5Q804-699 834-629.5T864-480q0 79-30 149t-82.5 122.5Q699-156 629.5-126T480-96Z"/></svg>';
}
function le_rg(a) {
  return a.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
}
class le_sg {}
class le_6 extends le_sg {
  constructor() {
    super();
    this.Ta = !1;
  }
  V() {
    throw Error("Not implemented");
  }
  show() {
    this.Ta || (this.V(), (this.Ta = !0));
    le_tg.push(this);
  }
  hide() {
    le_tg.pop();
  }
  P() {
    this.Ta && this.C();
  }
}
class le_ug {
  constructor() {
    const a = this;
    a.g = [];
    $(document).on("keyup", function (b) {
      27 === b.keyCode && ((b = a.g[a.g.length - 1]), null != b && b.hide(!0));
    });
  }
  push(a) {
    this.g.push(a);
  }
  pop() {
    return this.g.pop();
  }
}
const le_tg = new le_ug();
function le_vg(a) {
  const b = $(
    '<div class="filters-header"><div class="header-text"></div><div class="header-close-btn"><svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="12" height="12" style="fill:#f00;" viewBox="0 0 172 172"><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g fill="#ddd"><path d="M40.13333,22.93333c-1.46702,0 -2.93565,0.55882 -4.05365,1.67969l-11.46667,11.46667c-2.24173,2.24173 -2.24173,5.87129 0,8.10729l41.81302,41.81302l-41.81302,41.81302c-2.24173,2.24173 -2.24173,5.87129 0,8.10729l11.46667,11.46667c2.24173,2.24173 5.87129,2.24173 8.10729,0l41.81302,-41.81302l41.81302,41.81302c2.236,2.24173 5.87129,2.24173 8.10729,0l11.46667,-11.46667c2.24173,-2.24173 2.24173,-5.87129 0,-8.10729l-41.81302,-41.81302l41.81302,-41.81302c2.24173,-2.236 2.24173,-5.87129 0,-8.10729l-11.46667,-11.46667c-2.24173,-2.24173 -5.87129,-2.24173 -8.10729,0l-41.81302,41.81302l-41.81302,-41.81302c-1.12087,-1.12087 -2.58663,-1.67969 -4.05365,-1.67969z"></path></g></g></svg></div></div>'
  ).appendTo(a);
  b.find(".header-close-btn").click(function () {
    a.hide();
  });
  return b;
}
function le_wg(a) {
  const b = $(
      '<div class="search-block"><input type="search" placeholder=""><span class="search-clear" style="display: none;"><svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="16" height="16" viewBox="0 0 24 24" style="fill:#808080;"><path d="M12,2C6.47,2,2,6.47,2,12s4.47,10,10,10s10-4.47,10-10S17.53,2,12,2z M17,15.59L15.59,17L12,13.41L8.41,17L7,15.59 L10.59,12L7,8.41L8.41,7L12,10.59L15.59,7L17,8.41L13.41,12L17,15.59z"></path></svg></span></div>'
    ).appendTo(a),
    c = b.find("input"),
    d = b.find(".search-clear");
  c.keyup(
    le_xg(function () {
      const f = c.val().trim();
      "" == f ? d.hide() : d.show();
      le_yg(a, f);
    }, 50)
  );
  d.click(function () {
    c.val("");
    d.hide();
    le_yg(a, "");
  });
  return b;
}
function le_zg(a) {
  a.filter.Eb = {};
  a.filter.ob = {};
  a.filter.Qb = {};
  a.filter.authors = {};
  a.filter.xb = {};
}
function le_Ag(a) {
  let b = le__;
  a = le_Bg(a);
  0 < a.length && (b += "/filter/" + a.join("&"));
  return b;
}
function le_Cg(a, b) {
  return $.isArray(b)
    ? a.filter(function (c) {
        let d = !1;
        for (let f = 0; f < b.length; f++)
          if (c.cycle === b[f]) {
            d = !0;
            break;
          }
        return d;
      })
    : a.filter(function (c) {
        return c.cycle === b;
      });
}
function le_Dg(a, b) {
  return $.isArray(b)
    ? a.filter(function (c) {
        let d = !1;
        for (let f = 0; f < b.length; f++)
          if (c.gameVersionBase === b[f]) {
            d = !0;
            break;
          }
        return d;
      })
    : a.filter(function (c) {
        return c.gameVersionBase === b;
      });
}
function le_Eg(a) {
  switch (a) {
    case "primalist":
      return "0-0";
    case "beastmaster":
      return "0-1";
    case "shaman":
      return "0-2";
    case "druid":
      return "0-3";
    case "mage":
      return "1-0";
    case "sorcerer":
      return "1-1";
    case "spellblade":
      return "1-2";
    case "runemaster":
      return "1-3";
    case "sentinel":
      return "2-0";
    case "void_knight":
      return "2-1";
    case "forge_guard":
      return "2-2";
    case "paladin":
      return "2-3";
    case "acolyte":
      return "3-0";
    case "necromancer":
      return "3-1";
    case "lich":
      return "3-2";
    case "warlock":
      return "3-3";
    case "rogue":
      return "4-0";
    case "bladedancer":
      return "4-1";
    case "marksman":
      return "4-2";
    case "falconer":
      return "4-3";
  }
}
function le_Fg(a, b) {
  let c = (d, f) => f.every((k) => d.includes(k));
  return a.filter(function (d) {
    return c(d.classes, b);
  });
}
function le_Gg(a, b) {
  let c = (d, f) => f.every((k) => d.includes(k));
  return a.filter(function (d) {
    return c(d.skills, b);
  });
}
function le_Hg(a, b) {
  return $.isArray(b)
    ? a.filter(function (c) {
        let d = !1;
        for (let f = 0; f < b.length; f++)
          if (c.authorId == b[f]) {
            d = !0;
            break;
          }
        return d;
      })
    : a.filter(function (c) {
        return c.authorId == b;
      });
}
function le_Ig(a, b) {
  let c = (d, f) => f.every((k) => d.includes(k));
  return a.filter(function (d) {
    return c(d.tags, b);
  });
}
function le_Jg(a, b) {
  const c = new RegExp(le_Kg(b), "ig");
  return a.filter(function (d) {
    if (
      d.title.match(c) ||
      d.description.match(c) ||
      (authors[d.authorId] && authors[d.authorId].match(c))
    )
      return !0;
    for (var f = 0; f < d.classes.length; f++) {
      var k = d.classes[f].split("-");
      k = le_Lg(+k[0], +k[1]);
      const n = le_e(k);
      if (k && n.match(c)) return !0;
    }
    for (f = 0; f < d.tags.length; f++) if (d.tags[f].match(c)) return !0;
    for (f = 0; f < d.skills.length; f++)
      if ((k = LEAbilities.abilityList[d.skills[f]]) && le_f(k).match(c))
        return !0;
    return !1;
  });
}
function le_eg(a, b) {
  b = b.slice();
  b.sort(function (p, r) {
    return r.date - p.date;
  });
  b.forEach(function (p, r) {
    p.index = r + 1;
    p.cycle = le_la(p.gameVersionBase).tag;
  });
  const c = Object.keys(a.filter.ic),
    d = Object.keys(a.filter.Eb),
    f = Object.keys(a.filter.ob),
    k = Object.keys(a.filter.Qb),
    n = Object.keys(a.filter.authors),
    m = Object.keys(a.filter.xb);
  if (0 < c.length) {
    let p = [];
    c.forEach(function (r) {
      p.push(r);
    });
    0 < p.length && (1 == p.length && (p = p[0]), (b = le_Cg(b, p)));
  }
  if (0 < d.length) {
    let p = [];
    d.forEach(function (r) {
      p.push(r);
    });
    0 < p.length && (1 == p.length && (p = p[0]), (b = le_Dg(b, p)));
  }
  if (0 < f.length) {
    let p = [];
    f.forEach(function (r) {
      r = le_Eg(r);
      null != r && p.push(r);
    });
    0 < p.length && (b = le_Fg(b, p));
  }
  if (0 < k.length) {
    let p = [];
    k.forEach(function (r) {
      (r = a.g[r]) && p.push(r.id);
    });
    0 < p.length && (b = le_Gg(b, p));
  }
  if (0 < n.length) {
    let p = [];
    n.forEach(function (r) {
      p.push(r);
    });
    0 < p.length && (1 == p.length && (p = p[0]), (b = le_Hg(b, p)));
  }
  if (0 < m.length) {
    let p = [];
    m.forEach(function (r) {
      null != le_Yd(r) && p.push(r);
    });
    0 < p.length && (b = le_Ig(b, p));
  }
  a.o && (b = le_Jg(b, a.o));
  a.entries = b;
}
function le_Lg(a, b) {
  return (a = classInfoForSources[a]) ? a.characterClass.masteries[b] : null;
}
function le_Bg(a) {
  const b = Object.keys(a.filter.Qb),
    c = Object.keys(a.filter.ob),
    d = Object.keys(a.filter.ic),
    f = Object.keys(a.filter.Eb),
    k = Object.keys(a.filter.authors);
  a = Object.keys(a.filter.xb);
  const n = [];
  0 < b.length && n.push("skill=" + b.join("+"));
  0 < c.length && n.push("class=" + c.join("+"));
  0 < d.length && n.push("cycle=" + d.join("+"));
  if (0 < f.length) {
    const m = [];
    f.forEach(function (p) {
      m.push(le_ia(p));
    });
    n.push("version=" + m.join("+"));
  }
  if (0 < k.length) {
    const m = [];
    k.forEach(function (p) {
      m.push(authors[p]);
    });
    n.push("author=" + m.join("+"));
  }
  0 < a.length && n.push("tag=" + a.join("+"));
  return n;
}
function le_dg(a, b) {
  var c = $.ia(b, "skill");
  c = c ? c.split("+") : [];
  var d = $.ia(b, "class");
  d = d ? d.split("+") : [];
  var f = $.ia(b, "cycle");
  f = f ? f.split("+") : [];
  var k = $.ia(b, "version");
  k = k ? k.split("+") : [];
  var n = $.ia(b, "author");
  n = n ? n.split("+") : [];
  b = (b = $.ia(b, "tag")) ? b.split("+") : [];
  le_zg(a);
  c.forEach(function (m) {
    a.filter.Qb[m] = !0;
  });
  d.forEach(function (m) {
    a.filter.ob[m] = !0;
  });
  f.forEach(function (m) {
    le_na(m) && (a.filter.ic[m] = !0);
  });
  k.forEach(function (m) {
    (m = le_ja(m)) && (a.filter.Eb[m] = !0);
  });
  n.forEach(function (m) {
    (m = a.i[m]) && (a.filter.authors[m] = !0);
  });
  b.forEach(function (m) {
    a.filter.xb[m] = !0;
  });
}
function le_fg(a, b) {
  var c = le_Mg();
  const d = le_Ng(a, a.entries),
    f = $(".entry-list");
  le_gg(a);
  f.empty();
  let k = 0;
  1 < b && (k = a.l * (b - 1));
  const n = $(c).appendTo(f),
    m = n.DataTable({
      data: d,
      paging: !0,
      pageLength: a.l,
      displayStart: k,
      lengthChange: !1,
      info: !1,
      searchDelay: 200,
      orderClasses: !1,
      deferRender: !0,
      columns: [
        { width: "16px", data: "index" },
        {
          className: "tbl1-col-title",
          data: "title",
          render: { _: "display", sort: "text", filter: "text" },
        },
        {
          className: "tbl1-col-author",
          data: "author",
          render: { _: "display", sort: "text", filter: "text" },
        },
        {
          className: "tbl1-col-tags",
          data: "tags",
          render: { _: "display", sort: "text", filter: "text" },
        },
        { width: "94px", data: "gameVersion" },
      ],
      language: {
        emptyTable: le_.t("loot_filters.list.empty"),
        zeroRecords: le_.t("loot_filters.list.no_matches"),
      },
    });
  n.on("search.dt", function () {
    le_Og(a, n);
    const p = {};
    m.rows({ filter: "applied" })
      .data()
      .toArray()
      .forEach(function (w) {
        p[w.index] = !0;
      });
    const r = a.entries.filter(function (w) {
      return p[w.index];
    });
    le_Pg(a, n, a.j, r);
    le_Qg(a, f, r, 1);
    le_hg(a, r);
  });
  c = n.parent().find(".dataTables_filter label");
  c[0].childNodes[0].remove();
  c.find("input").attr(
    "placeholder",
    le_.t("loot_filters.list.search_placeholder")
  );
  le_Rg(c);
  le_Sg(a, n);
  le_Tg(a, n);
  le_Pg(a, n, a.j, a.entries);
  le_Qg(a, f, a.entries, b);
  le_hg(a, a.entries);
}
function le_gg(a) {
  a.B.forEach(function (b) {
    b.destroy();
  });
}
function le_hg(a, b) {
  let c = $(".entry-list-filter .filter-list");
  c.empty();
  le_Ug(a);
  le_Vg(a, c, b);
  le_Wg(a, c, b);
  le_Xg(a, c, b);
  le_Yg(a, c, b);
  le_Zg(a, c, b);
  le__g(a, c, b);
  le_0g(a, c);
}
function le_Mg() {
  const a = le_.t("loot_filters.list.column_title"),
    b = le_.t("loot_filters.list.column_author"),
    c = le_.t("loot_filters.list.column_tags"),
    d = le_.t("loot_filters.list.column_cycle_version");
  return (
    '<table id="loot-filters" class="cell-border hover" style="width:100%"><thead><tr><th class="tbl1-header-index">#</th>' +
    `<th class="tbl1-header-title">${a}</th>` +
    `<th class="tbl1-header-author">${b}</th>` +
    `<th class="tbl1-header-tags">${c}</th>` +
    `<th class="tbl1-header-version">${d}</th>` +
    "</tr></thead><tbody></tbody></table>"
  );
}
function le_Ng(a, b) {
  const c = [];
  b.forEach(function (d) {
    var f = c.push,
      k = a.J[d.index];
    if (!k) {
      k = d.index;
      var n = le_rg(d.title);
      var m = d.icon.split(","),
        p = `<div class="lf_icons lf_icons-${lootFilterIcons[m[0]].substr(
          2
        )}" style="background-color:${lootFilterIconColors[m[1]]}"></div>`,
        r = d.id;
      n = {
        display: `<a class="loot-filter-link" href="${le_c(
          "/loot-filters"
        )}/view/${r}" loot-filter-id="${r}">${
          0 == m[0] ? "" : `<span class="icon">${p}</span>`
        }${n}</a>`,
        text: d.title,
      };
      (m = authors[d.authorId])
        ? (p = le_1g("author", m, le_rg(m)))
        : ((m = p = "-"), console.warn("No author for filter", d));
      m = { display: m, text: p };
      p = le_2g(d.tags);
      r = le_3g(d.skills);
      const w = le_4g(d.classes),
        z = `${p.html}${w.html}${r.html}`;
      p = {
        display: z
          ? `<div class="filter-tags">${z}</div>`
          : le_.t("loot_filters.list.tags.none"),
        text: [p.text, w.text, r.text].join(),
      };
      r = le_ia(d.gameVersionBase);
      r = le_ja(r, !0);
      d = `${le_oa(d.cycle)} / ${r}`;
      k = { index: k, title: n, author: m, tags: p, gameVersion: d };
    }
    f.call(c, k);
  });
  return c;
}
function le_Og(a, b) {
  setTimeout(function () {
    le_gg(a);
    le_Sg(a, b);
    le_Tg(a, b);
  }, 100);
}
function le_Pg(a, b, c, d) {
  a = le_5g(a, c).Od;
  d = $(
    '<h1 class="dataTables_header">' +
      `${a} <span class="entry-count">(${d.length})</span>` +
      "</h1>"
  );
  b.parent().find(".dataTables_header").remove();
  b.parent().prepend(d);
  le_mb.g(d);
}
function le_Qg(a, b, c, d) {
  const f = `${le_c("/loot-filters")}${le_Ag(a)}/(:num)`;
  c = new le_5a(c.length, a.l, d, f);
  c.j = 5;
  c = $(`<div class="pagination-wrapper">${le_4a(c)}</div>`);
  c.find("a").click(function (k) {
    k.preventDefault();
    k = +$(this)
      .attr("href")
      .replace(/^.*\/(\d+)$/, "$1");
    let n = le_Ag(a);
    1 < k && (n += "/" + k);
    le_Z(n);
    document.body.scrollTo({ top: 0, behavior: "smooth" });
  });
  b.find(".pagination-wrapper").remove();
  c.appendTo(b);
}
function le_Rg(a) {
  $(
    '<div class="filter-btn"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><g><path d="M0,0h24 M24,24H0" fill="none"></path><path d="M4.25,5.61C6.27,8.2,10,13,10,13v6c0,0.55,0.45,1,1,1h2c0.55,0,1-0.45,1-1v-6c0,0,3.72-4.8,5.74-7.39 C20.25,4.95,19.78,4,18.95,4H5.04C4.21,4,3.74,4.95,4.25,5.61z"></path><path d="M0,0h24v24H0V0z" fill="none"></path></g></svg></div>'
  )
    .appendTo(a)
    .click(function () {
      $(".entry-list-filter").show();
    });
}
function le_Sg(a, b) {
  a.B = [];
  b.find(".tbl1-col-tags a.ability-link").each(function () {
    var c = $(this),
      d = c.attr("ability_id");
    d = LEAbilities.abilityList[d];
    c = tippy(c[0], {
      theme: "plain",
      content: d ? le_f(d) : "",
      allowHTML: !1,
      arrow: !1,
      placement: "top",
      offset: [0, 2],
    });
    a.B.push(c);
  });
}
function le_Tg(a, b) {
  const c = b.find("a.filter-link");
  c.off("click", a.C.bind(a));
  c.on("click", a.C.bind(a));
  b = b.find("a.loot-filter-link");
  b.off("click", a.I.bind(a));
  b.on("click", a.I.bind(a));
}
function le_2g(a) {
  const b = [],
    c = [];
  le_Wd.Qa.forEach(function (d) {
    if (-1 != a.indexOf(d)) {
      const f = le_Yd(d);
      b.push(f);
      c.push(le_1g("tag", d, f));
    }
  });
  return 0 < b.length
    ? { text: b.join(","), html: c.join("") }
    : { text: "", html: "" };
}
function le_3g(a) {
  const b = [],
    c = [];
  a.forEach(function (d) {
    var f = LEAbilities.abilityList[d];
    if (f) {
      d = f.id;
      const k = le_f(f),
        n = le_kb(f.internalName);
      f = le_Db(f);
      b.push(k);
      c.push(
        `<a href="${le_c(
          "/skills"
        )}/${n}" class="ability-link icon-inline" ability_id="${d}" alt="${k}">` +
          `<span class="${f}"></span>` +
          "</a>"
      );
    }
  });
  return 0 < b.length
    ? { text: b.join(","), html: c.join("") }
    : { text: "", html: "" };
}
function le_4g(a) {
  const b = [],
    c = [];
  a.forEach(function (d) {
    d = d.split("-");
    var f = le_Lg(+d[0], +d[1]);
    f &&
      ((d = f.name.toLowerCase().replaceAll(" ", "_")),
      (f = le_e(f)),
      b.push(f),
      c.push(le_1g("class", d, f)));
  });
  return 0 < b.length
    ? { text: b.join(","), html: c.join("") }
    : { text: "", html: "" };
}
function le_Ug(a) {
  a.m.forEach(function (b) {
    b.destroy();
  });
}
function le_Vg(a, b, c) {
  const d = {},
    f = c.length;
  $.each(c, function (m, p) {
    m = p.cycle;
    d[m] = (d[m] || 0) + 1;
  });
  const k = [];
  $.each(le_ma, function (m, p) {
    m = p.tag;
    p = d[m];
    null != p &&
      k.push({ na: m, selected: a.filter.ic[m], usage: p / f, count: p });
  });
  k.reverse();
  const n = [];
  $.each(k, function (m, p) {
    m = le_oa(p.na);
    n.push(
      le_6g(
        "cycle-row",
        "rgba(222,194,163,0.15)",
        m,
        p.count,
        p.na,
        p.selected,
        '<div class="cycle-name">' + m + "</div>"
      )
    );
  });
  c =
    0 == n.length
      ? `<div class="cycle-row empty-row">${le_.t(
          "builds.filters.no_entries"
        )}</div>`
      : `<div class="cycle-row no-matches-row">${le_.t(
          "builds.filters.no_matches"
        )}</div>` + n.join("");
  $(
    '<div class="content-block block-cycles">' +
      `<div class="title">${le_.t(
        "builds.filter_category.game_cycles"
      )}</div>` +
      `<div class="content">${c}</div>` +
      "</div>"
  ).appendTo(b);
  le_7g(a, b, "cycle-row", a.filter.ic);
}
function le_Wg(a, b, c) {
  const d = {},
    f = c.length;
  c.forEach(function (m) {
    m = m.gameVersionBase;
    d[m] = (d[m] || 0) + 1;
  });
  c = Object.keys(d);
  c.sort(le_ka);
  c.reverse();
  const k = [];
  c.forEach(function (m) {
    const p = d[m];
    k.push({ na: m, selected: a.filter.Eb[m], usage: p / f, count: p });
  });
  const n = [];
  k.forEach(function (m) {
    var p = le_ia(m.na);
    p = le_ja(p, !0);
    n.push(
      le_6g(
        "version-row",
        "rgba(222,194,163,0.15)",
        p,
        m.count,
        m.na,
        m.selected,
        '<div class="version-name">' + p + "</div>"
      )
    );
  });
  c =
    0 == n.length
      ? `<div class="version-row empty-row">${le_.t(
          "builds.filters.no_entries"
        )}</div>`
      : `<div class="version-row no-matches-row">${le_.t(
          "builds.filters.no_matches"
        )}</div>` + n.join("");
  $(
    '<div class="content-block block-versions">' +
      `<div class="title">${le_.t(
        "builds.filter_category.game_versions"
      )}</div>` +
      `<div class="content">${c}</div>` +
      "</div>"
  ).appendTo(b);
  le_7g(a, b, "version-row", a.filter.Eb);
}
function le_Xg(a, b, c) {
  const d = {},
    f = c.length;
  c.forEach(function (m) {
    m.classes.forEach(function (p) {
      p && (d[p] = (d[p] || 0) + 1);
    });
  });
  const k = [];
  Object.entries(d).forEach(function (m) {
    const [p, r] = m;
    var w = p.split("-");
    m = +w[0];
    w = +w[1];
    var z = le_Lg(m, w);
    z &&
      ((z = z.name.toLowerCase().replaceAll(" ", "_")),
      k.push({ ne: m, Je: w, na: z, selected: a.filter.ob[z], usage: r / f }));
  });
  k.sort(function (m, p) {
    let r = (p.selected ? 1 : 0) - (m.selected ? 1 : 0);
    return 0 != r ? r : p.usage - m.usage;
  });
  const n = [];
  k.forEach(function (m) {
    const p = m.ne;
    var r = le_Lg(p, m.Je);
    var w =
      '<span class="icon-inline"><span class="bg ' +
      r.icon.replace(/^([^\-]+)/, "bg") +
      '"></span></span>' +
      le_e(r);
    r = le_e(r);
    n.push(
      le_6g(
        "cls-row",
        "rgba(48,227,227,0.15)",
        r,
        Math.round(1e3 * m.usage) / 10 + "%",
        m.na,
        m.selected,
        '<div class="class-icon-name class-icon-' + p + '">' + w + "</div>"
      )
    );
  });
  c =
    0 == n.length
      ? `<div class="cls-row empty-row">${le_.t(
          "builds.filters.no_entries"
        )}</div>`
      : `<div class="cls-row no-matches-row">${le_.t(
          "builds.filters.no_matches"
        )}</div>` + n.join("");
  $(
    '<div class="content-block block-classes">' +
      `<div class="title">${le_.t(
        "loot_filters.filter_category.classes"
      )}</div>` +
      `<div class="content">${c}</div>` +
      "</div>"
  ).appendTo(b);
  le_7g(a, b, "cls-row", a.filter.ob);
}
function le_Yg(a, b, c) {
  const d = {};
  c.forEach(function (p) {
    p.skills.forEach(function (r) {
      r && (d[r] = (d[r] || 0) + 1);
    });
  });
  const f = c.length,
    k = {};
  Object.entries(d).forEach(function (p) {
    const [r, w] = p;
    LEAbilities.abilityList[r] && (k[r] = w);
  });
  const n = [];
  Object.entries(k).forEach(function (p) {
    const [r, w] = p;
    p = LEAbilities.abilityList[r];
    const z = le_kb(p.internalName);
    n.push({ Wc: p, na: z, selected: a.filter.Qb[z], usage: w / f });
  });
  n.sort(function (p, r) {
    let w = (r.selected ? 1 : 0) - (p.selected ? 1 : 0);
    return 0 != w ? w : r.usage - p.usage;
  });
  const m = [];
  n.forEach(function (p) {
    const r = le_Db(p.Wc);
    var w = le_f(p.Wc);
    m.push(
      le_6g(
        "skill-row",
        "rgba(46,107,227,0.15)",
        w,
        Math.round(1e3 * p.usage) / 10 + "%",
        p.na,
        p.selected,
        '<a class="ability-link ability-icon-name" ability_id="' +
          p.Wc.id +
          '"><div class="ability-icon-inline"><div class="' +
          r +
          '"></div></div><div>' +
          w +
          "</div></a>"
      )
    );
  });
  c =
    0 == m.length
      ? `<div class="skill-row empty-row">${le_.t(
          "loot_filters.filters.no_entries"
        )}</div>`
      : `<div class="skill-row no-matches-row">${le_.t(
          "loot_filters.filters.no_matches"
        )}</div>` + m.join("");
  $(
    '<div class="content-block block-skills">' +
      `<div class="title">${le_.t(
        "loot_filters.filter_category.skills"
      )}</div>` +
      `<div class="content">${c}</div>` +
      "</div>"
  ).appendTo(b);
  le_7g(a, b, "skill-row", a.filter.Qb);
}
function le_Zg(a, b, c) {
  const d = {},
    f = c.length;
  c.forEach(function (m) {
    m.tags.forEach(function (p) {
      const r = le_Yd(p);
      p && r && (d[p] = (d[p] || 0) + 1);
    });
  });
  const k = [];
  Object.entries(d).forEach(function (m) {
    const [p, r] = m;
    k.push({ na: p, selected: a.filter.xb[p], usage: r / f });
  });
  k.sort(function (m, p) {
    let r = (p.selected ? 1 : 0) - (m.selected ? 1 : 0);
    return 0 != r ? r : p.usage - m.usage;
  });
  const n = [];
  k.forEach(function (m) {
    const p = le_Yd(m.na);
    n.push(
      le_6g(
        "tag-row",
        "rgba(227,227,27,0.15)",
        p,
        Math.round(1e3 * m.usage) / 10 + "%",
        m.na,
        m.selected,
        '<div class="tag-name">' + p + "</div>"
      )
    );
  });
  c =
    0 == n.length
      ? `<div class="tag-row empty-row">${le_.t(
          "builds.filters.no_entries"
        )}</div>`
      : `<div class="tag-row no-matches-row">${le_.t(
          "builds.filters.no_matches"
        )}</div>` + n.join("");
  $(
    '<div class="content-block block-tags">' +
      `<div class="title">${le_.t("builds.filter_category.tags")}</div>` +
      `<div class="content">${c}</div>` +
      "</div>"
  ).appendTo(b);
  le_7g(a, b, "tag-row", a.filter.xb);
}
function le__g(a, b, c) {
  const d = {},
    f = c.length;
  c.forEach(function (m) {
    m = m.authorId;
    d[m] = (d[m] || 0) + 1;
  });
  const k = [];
  Object.entries(d).forEach(function (m) {
    const [p, r] = m;
    k.push({ na: p, selected: a.filter.authors[p], usage: r / f });
  });
  k.sort(function (m, p) {
    let r = (p.selected ? 1 : 0) - (m.selected ? 1 : 0);
    return 0 != r ? r : p.usage - m.usage;
  });
  const n = [];
  k.forEach(function (m) {
    const p = authors[m.na];
    n.push(
      le_6g(
        "author-row",
        "rgba(227,227,227,0.15)",
        p,
        Math.round(1e3 * m.usage) / 10 + "%",
        m.na,
        m.selected,
        '<div class="author-name">' + p + "</div>"
      )
    );
  });
  c =
    0 == n.length
      ? `<div class="author-row empty-row">${le_.t(
          "builds.filters.no_entries"
        )}</div>`
      : `<div class="author-row no-matches-row">${le_.t(
          "builds.filters.no_matches"
        )}</div>` + n.join("");
  $(
    '<div class="content-block block-authors">' +
      `<div class="title">${le_.t("builds.filter_category.authors")}</div>` +
      `<div class="content">${c}</div>` +
      "</div>"
  ).appendTo(b);
  le_7g(a, b, "author-row", a.filter.authors);
}
function le_0g(a, b) {
  a.m = le_mb.g(b);
  a.m.forEach(function (c) {
    c.setProps({ interactive: !1 });
  });
}
function le_yg(a, b) {
  b = b.toLowerCase().replace(/\s+/g, " ").trim();
  const c = new RegExp(le_Kg(b), "ig");
  "block-cycles block-versions block-classes block-skills block-tags block-authors"
    .split(" ")
    .forEach(function (d) {
      d = a.find(".content-block." + d + " .content");
      let f = !1;
      d.children().each(function () {
        const k = $(this),
          n = k.attr("data-search");
        null != n && (n.match(c) ? ((f = !0), k.show()) : k.hide());
      });
      d = d.find(".no-matches-row");
      f ? d.hide() : d.show();
    });
}
function le_6g(a, b, c, d, f, k, n) {
  return k
    ? '<div class="' +
        a +
        ' row-selected" filter-val="' +
        f +
        '" data-search="' +
        c +
        '">' +
        n +
        '<div class="filter-btn-remove centered"><svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="12" height="12" style="fill:#f00;" viewBox="0 0 172 172"><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g fill="#ddd"><path d="M40.13333,22.93333c-1.46702,0 -2.93565,0.55882 -4.05365,1.67969l-11.46667,11.46667c-2.24173,2.24173 -2.24173,5.87129 0,8.10729l41.81302,41.81302l-41.81302,41.81302c-2.24173,2.24173 -2.24173,5.87129 0,8.10729l11.46667,11.46667c2.24173,2.24173 5.87129,2.24173 8.10729,0l41.81302,-41.81302l41.81302,41.81302c2.236,2.24173 5.87129,2.24173 8.10729,0l11.46667,-11.46667c2.24173,-2.24173 2.24173,-5.87129 0,-8.10729l-41.81302,-41.81302l41.81302,-41.81302c2.24173,-2.236 2.24173,-5.87129 0,-8.10729l-11.46667,-11.46667c-2.24173,-2.24173 -5.87129,-2.24173 -8.10729,0l-41.81302,41.81302l-41.81302,-41.81302c-1.12087,-1.12087 -2.58663,-1.67969 -4.05365,-1.67969z"></path></g></g></svg></div></div>'
    : '<div class="' +
        a +
        '" style="background: linear-gradient(to left, ' +
        b +
        " " +
        d +
        ", transparent " +
        d +
        ');" filter-val="' +
        f +
        '" data-search="' +
        c +
        '">' +
        n +
        '<div class="usage">' +
        d +
        "</div></div>";
}
function le_7g(a, b, c, d) {
  b.find("." + c).click(function () {
    const f = $(this).attr("filter-val");
    d[f] = !0;
    le_Z(le_Ag(a));
  });
  b.find("." + c + " .filter-btn-remove").click(function (f) {
    f.preventDefault();
    f.stopPropagation();
    f = $(this)
      .parent("." + c)
      .attr("filter-val");
    delete d[f];
    le_Z(le_Ag(a));
  });
}
function le_1g(a, b, c) {
  return `<a href="${le_c(
    "/loot-filters"
  )}${le__}/filter/${a}=${b}" class="link filter-link ${""}" filter-field="${a}" filter-val="${b}">${c}</a>`;
}
function le_5g(a, b) {
  const c = [],
    d = [];
  var f = [],
    k = [],
    n = $.ia(b, "class"),
    m = n ? n.split("+") : [];
  n = (n = $.ia(b, "tag")) ? n.split("+") : [];
  var p = $.ia(b, "cycle");
  p = p ? p.split("+") : [];
  var r = $.ia(b, "version");
  r = r ? r.split("+") : [];
  var w = $.ia(b, "skill");
  w = w ? w.split("+") : [];
  b = (b = $.ia(b, "author")) ? b.split("+") : [];
  const z = le_Eg(m[0]);
  let I = !1,
    N = (m = le_.t("loot_filters.list_title.base.loot_filters"));
  z &&
    ((m = z.split("-")),
    (m = le_Lg(+m[0], +m[1])),
    (I = !0),
    (N = m =
      le_.t("loot_filters.list_title.base.class_loot_filters", {
        class: le_e(m, !1),
      })));
  0 < n.length &&
    n.forEach(function (C) {
      if ((C = le_Yd(C))) c.push(C), d.push(C);
    });
  if (0 < p.length) {
    const C = [],
      G = [];
    p.forEach(function (H) {
      if ((H = le_oa(H)))
        C.push(`<span class="highlighted">${H}</span>`), G.push(H);
    });
    0 < G.length &&
      (f.push(
        le_.t("loot_filters.list_title.suffix.for_cycle", {
          name: C.join(", "),
        })
      ),
      k.push(
        le_.t("loot_filters.list_title.suffix.for_cycle", {
          name: G.join(", "),
        })
      ));
  }
  if (0 < r.length) {
    const C = [],
      G = [];
    r.forEach(function (H) {
      if ((H = le_ja(H, !0)))
        C.push(`<span class="highlighted">${H}</span>`), G.push(H);
    });
    0 < G.length &&
      (f.push(
        le_.t("loot_filters.list_title.suffix.for_patch", {
          name: C.join(", "),
        })
      ),
      k.push(
        le_.t("loot_filters.list_title.suffix.for_patch", {
          name: G.join(", "),
        })
      ));
  }
  if (0 < w.length) {
    const C = [],
      G = [];
    w.forEach(function (H) {
      if ((H = a.g[H])) C.push(le_w(H)), G.push(le_f(H));
    });
    0 < G.length &&
      (f.push(
        le_.t("loot_filters.list_title.suffix.using_skills", {
          name: C.join(", "),
        })
      ),
      k.push(
        le_.t("loot_filters.list_title.suffix.using_skills", {
          name: G.join(", "),
        })
      ));
  }
  if (0 < b.length) {
    const C = Object.values(authors),
      G = [],
      H = [];
    b.forEach(function (x) {
      C.includes(x) &&
        ((x = le_rg(x)),
        G.push(`<span class="highlighted">${x}</span>`),
        H.push(x));
    });
    0 < G.length &&
      (f.push(
        le_.t("loot_filters.list_title.suffix.created_by", {
          name: G.join(", "),
        })
      ),
      k.push(
        le_.t("loot_filters.list_title.suffix.created_by", {
          name: H.join(", "),
        })
      ));
  }
  if (I || 0 != k.length || 0 != d.length)
    return (
      (n = 0 < c.length ? c.join(" ") : ""),
      (f = 0 < f.length ? f.join(", ") : ""),
      (k = le_
        .t("loot_filters.list_title.component_order", {
          prefixes: 0 < d.length ? d.join(" ") : "",
          baseText: N,
          suffixes: 0 < k.length ? k.join(", ") : "",
        })
        .trim()),
      (f = le_
        .t("loot_filters.list_title.component_order", {
          prefixes: n,
          baseText: m,
          suffixes: f,
        })
        .trim()),
      { Wd: k, Od: f }
    );
  k =
    "" == le__
      ? le_.t("loot_filters.groups.shared")
      : le_.t("loot_filters.groups.my");
  return { Wd: k, Od: k };
}
class le_lg extends le_sg {
  constructor() {
    super();
    this.l = 30;
    this.J = {};
    this.entries = this.A = null;
    this.filter = { ic: {}, Eb: {}, ob: {}, Qb: {}, authors: {}, xb: {} };
    this.g = {};
    this.B = [];
    this.m = [];
    this.o = this.j = "";
  }
  initData() {
    const a = this;
    Object.entries(LEAbilities.abilityList).forEach(function (b) {
      [, b] = b;
      if (b.internalName) {
        const c = le_kb(b.internalName);
        a.g[c] = b;
      }
    });
    a.i = {};
    Object.entries(authors).forEach(function (b) {
      const [c, d] = b;
      a.i[d] = c;
    });
  }
  V() {
    $(".entry-list-header");
    const a = $(".entry-list-filter");
    this.D = le_vg(a);
    this.F = le_wg(a);
    $('<div class="filter-list"></div>').appendTo(a);
  }
  sd(a) {
    let b = $.ia(a, "skill") || "",
      c = $.ia(a, "class") || "",
      d = $.ia(a, "cycle") || "",
      f = $.ia(a, "version") || "",
      k = $.ia(a, "author") || "";
    a = $.ia(a, "tag") || "";
    const n = [];
    b && n.push("skill=" + b);
    c && n.push("class=" + c);
    d && n.push("cycle=" + d);
    f && n.push("version=" + f);
    k && n.push("author=" + k);
    a && n.push("tag=" + a);
    return n.join("&");
  }
  C(a) {
    if (le_7f(a)) {
      a.preventDefault();
      var b = $(a.currentTarget).attr("filter-field");
      a = $(a.currentTarget).attr("filter-val");
      if ("version" == b) {
        if ((b = le_ja(a)))
          le_zg(this), (this.filter.Eb[b] = !0), le_Z(le_Ag(this));
      } else if ("author" == b) {
        if ((b = this.i[a]))
          le_zg(this), (this.filter.authors[b] = !0), le_Z(le_Ag(this));
      } else
        "class" == b
          ? (le_zg(this), (this.filter.ob[a] = !0), le_Z(le_Ag(this)))
          : "tag" == b &&
            (le_zg(this), (this.filter.xb[a] = !0), le_Z(le_Ag(this)));
    }
  }
  I(a) {
    le_7f(a) &&
      (a.preventDefault(),
      (a = $(a.currentTarget).attr("loot-filter-id")),
      null != a && le_Z(`/view/${a}`));
  }
  Ic(a) {
    return le_5g(this, a).Wd;
  }
  P() {
    this.D.find(".header-text").text(le_.t("loot_filters.filters.title"));
    this.F.find("input").attr(
      "placeholder",
      le_.t("loot_filters.filters.search_placeholder")
    );
  }
}
function le_bg(a) {
  if (a.ca) {
    if (!confirm(a.oa)) return !1;
    le_8g(a, !1);
  }
  return !0;
}
function le_9g(a, b) {
  null == b.rules ? le_$g(a, b.id) : le_ah(a, b);
}
function le_8g(a, b) {
  a.ca != b &&
    ((a.ca = b),
    a.ca
      ? window.addEventListener("beforeunload", le_bh, { capture: !0 })
      : window.removeEventListener("beforeunload", le_bh, { capture: !0 }));
}
function le_ch(a) {
  le_dh(a);
  const [b, c] = a.i.Wa.split(",");
  var d = lootFilterIcons[b];
  d = d ? d.substr(2) : "";
  const f = lootFilterIconColors[c];
  let k = le_eh(a, a.i.aa());
  k ||= le_.t("loot_filters.filter.no_description");
  var n = authors[a.i.Rc] || "";
  n = le_fh("author", n, le_rg(n));
  const m =
      '<span class="created-date">' + dayjs(a.i.vd).format("LL") + "</span>",
    p = '<span class="updated-date">' + dayjs(a.i.zd).format("LL") + "</span>",
    r = [].concat(le_gh(a), le_hh(a), le_ih(a), le_jh(a), le_kh(a));
  a.nb.html(
    `<div class="lf_icons lf_icons-${d}" style="background-color:${f}"></div>`
  );
  a.Mb.text(a.i.Na);
  a.Ba.html(k);
  a.Aa.html(
    le_.t("loot_filters.filter.created_by_on_date", {
      author: n,
      createdDate: m,
      updatedDate: p,
    })
  );
  a.ga.html(r.join(""));
  a.kc.find("a.filter-link").click(function (w) {
    if (le_7f(w) && (w.preventDefault(), le_bg(this))) {
      w = $(this).attr("filter-field");
      var z = $(this).attr("filter-val");
      le_Z(`${le__}/filter/${w}=${z}`);
    }
  });
  le_lh(a);
  le_mh(a, a.ga);
}
function le_nh(a) {
  a.o.removeClass("disabled-button");
  le_8g(a, !0);
}
function le_oh(a) {
  0 >= a.N.scrollTop()
    ? a.B.is(":visible") && a.B.hide()
    : a.B.is(":visible") || a.B.show();
}
function le_ph(a) {
  a.o.removeClass("disabled-button");
  le_8g(a, !0);
}
function le_qh(a, b) {
  a.i.da.unshift(b);
  le_rh(a, b);
  le_oh(a);
  le_sh(a);
  le_th(`.filter-rules .filter-rule-row[rule-id="${b.O()}"]`);
}
function le_uh(a) {
  tippy(a, { theme: "plain", arrow: !1, allowHTML: !0, delay: [100, 0] });
}
function le_vh(a) {
  var b = le_.t("loot_filters.filter.buttons.insert_rule.hint_line_1");
  const c = le_.t("loot_filters.filter.buttons.insert_rule.hint_line_2");
  null == a.M
    ? (a.L.addClass("disabled-button"),
      (b = `<div>${b}</div><div class='filter-tooltip-extra'>${c}</div>`))
    : a.L.removeClass("disabled-button");
  a.L[0]._tippy.setContent(b);
}
function le_wh(a) {
  if (!a.o.hasClass("disabled-button")) {
    a.o.addClass("disabled-button");
    le_xh(a, !1);
    a.X.show();
    a.i.Ka = gameVersion;
    const b = a.W.nc(a.i);
    le_0f(
      b,
      function (c) {
        console.log("Filter updated successfully");
        le_8g(a, !1);
        le_fd(a.C, c);
        le_ch(a);
        le_xh(a, !0);
        setTimeout(function () {
          a.X.hide();
        }, 1e3);
      },
      function () {
        a.o.removeClass("disabled-button");
        a.X.hide();
      }
    );
  }
}
function le_yh(a) {
  if (
    !a.D.hasClass("disabled-button") &&
    confirm(le_.t("loot_filters.filter.delete_confirmation"))
  ) {
    a.D.addClass("disabled-button");
    const b = a.i.Sc;
    le_1f(
      b,
      function () {
        console.log("Filter deleted successfully");
        le_8g(a, !1);
        le_gd(a.C, b);
        le_bg(a) && le_Z(le_$f || "/");
      },
      function () {
        a.D.removeClass("disabled-button");
      }
    );
  }
}
function le_zh(a) {
  le_bg(a) &&
    !a.g.hasClass("disabled-button") &&
    (a.g.addClass("disabled-button"),
    le_Ah(a, !1),
    a.R.show(),
    le_2f(
      a.i.Sc,
      function (b) {
        console.log("Filter duplicated successfully");
        a.g.removeClass("disabled-button");
        le_hd(a.C, b);
        le_Ah(a, !0);
        setTimeout(function () {
          a.R.hide();
        }, 1e3);
        le_Z(`/view/${b.id}`);
      },
      function () {
        a.g.removeClass("disabled-button");
        a.R.hide();
      }
    ));
}
function le_xh(a, b) {
  b = b
    ? le_.t("loot_filters.filter.status.saved")
    : le_.t("loot_filters.filter.status.saving");
  a.o[0]._tippy.setContent(b);
}
function le_Ah(a, b) {
  b = b
    ? le_.t("loot_filters.filter.status.duplicated")
    : le_.t("loot_filters.filter.status.duplicating");
  a.g[0]._tippy.setContent(b);
}
function le_rh(a, b, c = -1) {
  const d = new le_Bh({
    Ze: function (f) {
      a.S.show(f, a.l);
    },
    Qe: function (f, k) {
      if (k || confirm(le_.t("loot_filters.filter.delete_rule_confirmation")))
        a.deleteRule(d, f), le_ph(a);
    },
    Re: function (f) {
      le_Ch(a, f);
      le_ph(a);
    },
    Pe: function (f) {
      a.M = new le_N();
      f.copyTo(a.M);
      le_vh(a);
    },
    Ne: function () {
      le_ph(a);
    },
  });
  le_Dh(d, a.j, c);
  d.show(b, a.l);
  -1 == c ? a.A.unshift(d) : a.A.splice(c + 1, 0, d);
}
function le_sh(a) {
  const b = le_.t("loot_filters.filter.rules_title"),
    c = a.i.da.length;
  a.dd.text(`${b} (${c}/${a.ba})`);
  c < a.ba
    ? (a.j.removeClass("rule-limit-reached"),
      a.G.removeClass("disabled-button"))
    : (a.j.addClass("rule-limit-reached"), a.G.addClass("disabled-button"));
}
function le_th(a) {
  le_uh(`${a} div[data-tippy-content]`);
}
function le_$g(a, b) {
  le_8g(a, !1);
  le_Eh(a, !1);
  le_Fh(a);
  le_Gh(".filter-rules");
  a.j.empty();
  a.N.scrollTop(0);
  le_oh(a);
  le_Hh(a.m);
  a.K();
  le_Ih(a, !0);
  le_3f(
    b,
    function (c) {
      console.log("Filter loaded successfully");
      le_fd(a.C, c);
      le_ah(a, c);
    },
    function () {
      le_Ih(a, !1);
      le_Eh(a, !0);
    }
  );
}
function le_ah(a, b) {
  a.i = a.mb.parse(b);
  a.l = a.i.Rc != myUserId;
  le_8g(a, !1);
  le_Ih(a, !1);
  le_ch(a);
  le_vh(a);
  le_Eh(a, !1);
  le_Fh(a);
  le_Jh(a);
  le_Gh(".filter-rules");
  a.j.empty();
  b = a.i.da.slice();
  b.reverse();
  a.A = [];
  b.forEach(function (c) {
    le_rh(a, c);
  });
  le_sh(a);
  le_th(".filter-rules");
  a.N.scrollTop(0);
  le_oh(a);
  a.o.addClass("disabled-button");
  a.D.removeClass("disabled-button");
  le_Kh(a.m, a.i);
  a.K();
}
function le_Eh(a, b) {
  b
    ? (a.form.addClass("not-available"),
      a.g.addClass("disabled-button"),
      a.I.addClass("disabled-button"),
      a.m.sb.addClass("disabled-button"))
    : (a.form.removeClass("not-available"),
      a.g.removeClass("disabled-button"),
      a.I.removeClass("disabled-button"),
      a.m.sb.removeClass("disabled-button"));
}
function le_Fh(a) {
  a.l ? a.form.addClass("readonly") : a.form.removeClass("readonly");
}
function le_Gh(a) {
  $(`${a} div[data-tippy-content]`).each(function () {
    this._tippy.destroy();
  });
}
function le_Ih(a, b) {
  b
    ? (a.form.addClass("filter-loading"),
      a.g.addClass("disabled-button"),
      a.I.addClass("disabled-button"),
      a.m.sb.addClass("disabled-button"))
    : (a.form.removeClass("filter-loading"),
      a.g.removeClass("disabled-button"),
      a.I.removeClass("disabled-button"),
      a.m.sb.removeClass("disabled-button"));
}
function le_Jh(a) {
  isLoggedIn
    ? a.form.removeClass("not-logged")
    : (a.form.addClass("not-logged"),
      a.g.addClass("disabled-button"),
      a.R.setProps({
        trigger: "mouseenter focus",
        allowHTML: !0,
        theme: "plain",
        content: le_
          .t("loot_filters.errors.not_logged_in")
          .replace(/<a>([^<]+)<\/a>/i, '<a href="/forum/login">$1</a>'),
      }));
}
function le_Ch(a, b) {
  const c = new le_N();
  b.copyTo(c);
  const d = a.i.da.findIndex(function (f) {
    return f.O() == b.O();
  });
  -1 == d
    ? console.error("rule position not found")
    : (a.i.da.splice(d + 1, 0, c),
      le_rh(a, c, d),
      le_oh(a),
      le_sh(a),
      le_th(`.filter-rules .filter-rule-row[rule-id="${c.O()}"]`));
}
function le_dh(a) {
  $.each(a.Y, function (b, c) {
    c.destroy();
  });
}
function le_eh(a, b) {
  return b
    ? b.match(new RegExp(`^${a.F}/([^ /]+)$`))
      ? `<a href="${b}" target="_blank">${b}</a>`
      : le_rg(b)
    : "";
}
function le_fh(a, b, c) {
  return `<a href="/loot-filters${le__}/filter/${a}=${b}" class="link filter-link" filter-field="${a}" filter-val="${b}">${c}</a>`;
}
function le_gh(a) {
  a = a.i.Ka.replace(/[^\d]+$/, "");
  a = le_la(a);
  return [le_fh("cycle", a.tag, le_pa(a))];
}
function le_hh(a) {
  a = a.i.Ka.replace(/[^\d]+$/, "");
  a = le_ia(a);
  const b = le_ja(a, !0);
  return [le_fh("version", a, b)];
}
function le_ih(a) {
  const b = [];
  le_Wd.Qa.forEach(function (c) {
    -1 != a.i.getTags().indexOf(c) && b.push(le_fh("tag", c, le_Yd(c)));
  });
  return b;
}
function le_jh(a) {
  const b = [];
  a.i.Fb.forEach(function (c) {
    var d = c.split("-");
    c = +d[1];
    if ((d = classInfoForSources[+d[0]]))
      if ((c = d.characterClass.masteries[c]))
        (c = le_e(c)),
          (d = c.toLowerCase().replaceAll(" ", "_")),
          b.push(le_fh("class", d, c));
  });
  return b;
}
function le_kh(a) {
  const b = [];
  a.i.Hb.forEach(function (c) {
    if ((c = LEAbilities.abilityList[c])) {
      const d = c.id,
        f = le_f(c),
        k = le_kb(c.internalName);
      b.push(
        `<a href="/skills/${k}" class="ability-link icon-inline" ability_id="${d}" alt="${f}">` +
          `<span class="${le_Db(c)}"></span>` +
          "</a>"
      );
    }
  });
  return b;
}
function le_lh(a) {
  let b, c, d;
  switch (a.i.Ac) {
    case 0:
      b =
        '<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="m637-425-62-62q4-38-23-65.5T487-576l-62-62q13-5 27-7.5t28-2.5q70 0 119 49t49 119q0 14-2.5 28t-8.5 27Zm133 133-52-52q36-28 65.5-61.5T833-480q-49-101-144.5-158.5T480-696q-26 0-51 3t-49 10l-58-58q38-15 77.5-21t80.5-6q143 0 261.5 77.5T912-480q-22 57-58.5 103.5T770-292Zm-2 202L638-220q-38 14-77.5 21t-80.5 7q-143 0-261.5-77.5T48-480q22-57 58-104t84-85L90-769l51-51 678 679-51 51ZM241-617q-35 28-65 61.5T127-480q49 101 144.5 158.5T480-264q26 0 51-3.5t50-9.5l-45-45q-14 5-28 7.5t-28 2.5q-70 0-119-49t-49-119q0-14 3.5-28t6.5-28l-81-81Zm287 89Zm-96 96Z"/></svg>';
      c = le_Zd(0);
      d = le_.t("loot_filters.privacy.private.hint");
      break;
    case 1:
      b =
        '<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M480-384q-40 0-68-28t-28-68q0-40 28-68t68-28q40 0 68 28t28 68q0 40-28 68t-68 28Zm0 192q-142.596 0-259.798-78.5T48-480q55-131 172.202-209.5T480-768q135.345 0 247.172 70.5Q839-627 899-508h-82q-54-88-143.5-138T480-696q-112 0-207 58T127-480q51 100 146 158t207 58q25 0 49-3t47-9v74q-23 5-47 7.5t-49 2.5Zm0-120q26.54 0 51.27-8Q556-328 576-342q2-44 21-77t51-55.154V-480q0-70-49-119t-119-49q-70 0-119 49t-49 119q0 70 49 119t119 49Zm-8-168Zm200 336q-10.2 0-17.1-6.9-6.9-6.9-6.9-17.1v-144q0-10 7-17.5t17-6.5h24v-48q0-29.7 21.212-50.85 21.213-21.15 51-21.15Q798-456 819-434.85q21 21.15 21 50.85v48h24q10.2 0 17.1 6.9 6.9 6.9 6.9 17.1v144q0 10.2-6.9 17.1-6.9 6.9-17.1 6.9H672Zm60-192h72v-48q0-15.3-10.289-25.65-10.29-10.35-25.5-10.35Q753-420 742.5-409.65 732-399.3 732-384v48Z"/></svg>';
      c = le_Zd(1);
      d = le_.t("loot_filters.privacy.unlisted.hint");
      break;
    case 2:
      (b =
        '<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M480-312q70 0 119-49t49-119q0-70-49-119t-119-49q-70 0-119 49t-49 119q0 70 49 119t119 49Zm0-72q-40 0-68-28t-28-68q0-40 28-68t68-28q40 0 68 28t28 68q0 40-28 68t-68 28Zm0 192q-142.596 0-259.798-78.5T48-480q55-131 172.202-209.5T480-768q142.596 0 259.798 78.5T912-480q-55 131-172.202 209.5T480-192Zm0-288Zm0 216q112 0 207-58t146-158q-51-100-146-158t-207-58q-112 0-207 58T127-480q51 100 146 158t207 58Z"/></svg>'),
        (c = le_Zd(2)),
        (d = le_.t(
          "loot_filters.privacy.shared.hint",
          {},
          "filter-tooltip-highlighted2"
        ));
  }
  a.T.find(".privacy-icon").html(b);
  a.T.find(".privacy-text").text(c);
  a.T[0]._tippy.setContent(d);
}
function le_mh(a, b) {
  a.Y = [];
  b.find("a.ability-link").each(function () {
    var c = $(this),
      d = c.attr("ability_id");
    d = LEAbilities.abilityList[d];
    c = tippy(c[0], {
      theme: "plain",
      content: d ? le_f(d) : "",
      allowHTML: !1,
      arrow: !1,
      placement: "top",
      offset: [0, 2],
    });
    a.Y.push(c);
  });
}
class le_kg extends le_sg {
  constructor(a) {
    super();
    const b = this;
    b.ba = 75;
    b.A = [];
    b.l = !1;
    b.Y = [];
    le_8g(b, !1);
    b.F = `${window.location.protocol}//${window.location.host}/planner`;
    b.C = a;
    b.W = new le_Ef();
    b.mb = new le_Bf();
    b.form = $(".filter-view");
    b.mc = $(".filter-viewer .not-available-overlay");
    b.J = $(".filter-viewer .loading-overlay");
    b.dd = b.form.find(".filter-rules-title");
    b.j = b.form.find(".filter-rules");
    b.N = b.form.find(".filter-rules-wrapper");
    b.B = b.form.find(".filter-rules-header .shade-wrap");
    b.Ta = b.form.find(".filter-viewer-header .back-button");
    b.g = b.form.find(".filter-viewer-header .duplicate-filter-button");
    b.I = b.form.find(".filter-viewer-header .export-filter-button");
    b.o = b.form.find(".filter-viewer-header .save-filter-button");
    b.D = b.form.find(".filter-viewer-header .delete-filter-button");
    b.kc = b.form.find(".filter-name-wrapper");
    b.nb = b.form.find(".filter-viewer .filter-name .icon");
    b.Mb = b.form.find(".filter-viewer .filter-name .text");
    b.Ba = b.form.find(".filter-viewer .filter-description");
    b.Aa = b.form.find(".filter-viewer .filter-author-date");
    b.ga = b.form.find(".filter-viewer .filter-tags");
    b.fa = b.form.find(".filter-viewer .action-button.configure-filter-button");
    b.T = b.form.find(".filter-viewer .filter-privacy-button");
    b.G = b.form.find(".filter-viewer .add-rule-button");
    b.L = b.form.find(".filter-viewer .paste-rule-button");
    b.m = new le_Lh();
    b.Za = new le_Mh();
    b.ja = new le_Nh({
      rc: function () {},
      Nc: function (c) {
        b.i.Na = c.title;
        b.i.ec = c.description;
        b.i.Wa = `${c.icon},${c.qc}`;
        b.i.Ac = c.sc;
        b.i.Cc = c.Qa;
        b.i.Fb = c.hc;
        b.i.Hb = c.wc;
        le_ch(b);
        le_nh(b);
      },
    });
    b.S = new le_Oh({
      rc: function () {},
      Ye: function (c) {
        le_Ph(
          b.A.find(function (d) {
            return d.s.O() == c.O();
          })
        );
        le_oh(b);
        le_ph(b);
      },
      Le: function (c) {
        le_qh(b, c);
        le_ph(b);
      },
    });
    new Sortable(b.j[0], {
      animation: 150,
      ghostClass: "filter-rule-drag-ghost",
      chosenClass: "filter-rule-drag-chosen",
      dragClass: "filter-rule-dragged",
      fallbackClass: "filter-rule-drag-fallback",
      handle: ".rule-drag-handle",
      forceFallback: !0,
      onStart: function () {
        b.j.addClass("with-active-drag");
      },
      onEnd: function (c) {
        b.j.removeClass("with-active-drag");
        b.i.da.splice(c.newIndex, 0, b.i.da.splice(c.oldIndex, 1)[0]);
        le_ph(b);
      },
    });
    b.fa.click(function () {
      if (!b.l) {
        const [c, d] = b.i.Wa.split(",");
        b.ja.show({
          title: b.i.Na,
          description: b.i.aa(),
          icon: c,
          qc: d,
          sc: b.i.Ac,
          Qa: b.i.getTags(),
          hc: b.i.Fb,
          wc: b.i.Hb,
        });
      }
    });
    b.G.click(function () {
      var c = b.i.da.length;
      !b.l && c < b.ba && ((c = b.S), (c.o = null), c.S(new le_N(), !1));
    });
    le_uh(b.T[0]);
    b.L.click(function () {
      null != b.M && (le_qh(b, b.M), le_vh(b), le_nh(b));
    });
    le_uh(b.L[0]);
    b.X = tippy(b.o[0], {
      theme: "plain-condensed",
      placement: "top",
      arrow: !1,
      trigger: "",
    });
    b.R = tippy(b.g[0], {
      theme: "plain-condensed",
      placement: "top",
      arrow: !1,
      trigger: "",
    });
    b.o.click(function () {
      isLoggedIn && le_wh(b);
    });
    b.D.click(function () {
      isLoggedIn && le_yh(b);
    });
    b.g.click(function () {
      isLoggedIn && !b.g.hasClass("disabled-button") && le_zh(b);
    });
    b.Ta.click(function () {
      le_bg(b) && le_Z(le_$f || "/");
    });
    b.I.click(function () {
      b.I.hasClass("disabled-button") || b.Za.show(b.i);
    });
    b.m.sb.click(function () {
      b.m.sb.hasClass("disabled-button") || le_Kh(b.m, b.i);
    });
    b.N.on("scroll", function () {
      le_oh(b);
    });
  }
  deleteRule(a, b) {
    this.i.deleteRule(b);
    this.A = this.A.filter(function (c) {
      return c.s.O() !== b.O();
    });
    le_Gh(`.filter-rules .filter-rule-row[rule-id="${b.O()}"]`);
    a.remove();
    le_oh(this);
    le_sh(this);
  }
  K() {
    this.g.text(le_.t("loot_filters.filter.buttons.duplicate"));
    this.I.text(le_.t("loot_filters.filter.buttons.export"));
    this.o.text(le_.t("loot_filters.filter.buttons.save"));
    this.D.text(le_.t("loot_filters.filter.buttons.delete"));
    this.fa.text(le_.t("loot_filters.filter.buttons.configure"));
    this.G.text(le_.t("loot_filters.filter.buttons.add_rule"));
    this.j.attr("data-empty-content", le_.t("loot_filters.filter.no_rules"));
    this.mc.find("div").html(le_.t("loot_filters.filter.not_available"));
    this.J.find("div").html(le_.t("loot_filters.filter.loading"));
    this.oa = le_.t("loot_filters.filter.close_form_confirmation");
    this.m.K();
  }
  P() {
    this.K();
    this.i && le_sh(this);
    le_Jh(this);
    this.A.forEach(function (a) {
      a.P();
    });
    this.S.P();
    this.ja.P();
    this.m.P();
  }
}
const le_bh = (a) => {
  a.preventDefault();
  return (a.returnValue = "");
};
function le_Qh(a) {
  const b = [];
  le_Wd.g.forEach(function (c) {
    b.push(le_5(c, le_Zd(c)));
  });
  le_2(a, b, function () {});
}
function le_Rh(a, b) {
  const c = [];
  le_Wd.Qa.forEach(function (d) {
    c.push(le_5(d, le_Yd(d)));
  });
  le_3(b, c, le_Sh(a), function () {});
}
function le_Th(a, b) {
  const c = [];
  classInfoForSources.forEach(function (d, f) {
    const k = d.thirdMasteryUnlocked;
    d.characterClass.masteries.forEach(function (n, m) {
      const p = `${f}-${m}`;
      n = le_e(n);
      c.push(
        le_5(p, n, {
          Kb: 0 == m ? "opt-class" : "opt-mastery",
          disabled: !k && 3 == m,
        })
      );
    });
  });
  le_3(b, c, le_Sh(a), function () {}, { rd: !0 });
}
function le_Uh(a, b) {
  const c = [];
  le_qe().forEach(function (d) {
    c.push(le_5(d.id, d.name));
  });
  le_3(b, c, le_Sh(a), function () {});
}
function le_Vh(a) {
  const b = [];
  lootFilterIcons.forEach(function (c, d) {
    b.push(
      `<div class="item-block" item="${d}"><div class="lf_icons lf_icons-${c.substr(
        2
      )}"></div></div>`
    );
  });
  a.o.html(b.join(""));
  a.o.find("div.item-block").click(function () {
    const c = $(this).attr("item");
    le_Wh(a.o, c);
  });
}
function le_Xh(a) {
  const b = [];
  lootFilterIconColors.forEach(function (c, d) {
    b.push(
      `<div class="item-block" item="${d}"><div style="background:${c}"></div></div>`
    );
  });
  a.m.html(b.join(""));
  a.m.find("div.item-block").click(function () {
    const c = $(this).attr("item");
    le_Wh(a.m, c);
  });
}
function le_Yh(a) {
  a.j.val().trim() ? a.i.removeClass("disabled") : a.i.addClass("disabled");
}
function le_Zh(a) {
  let b = 0;
  a.find("div.item-block").each(function () {
    const c = $(this);
    c.hasClass("selected") && (b = +c.attr("item"));
  });
  return b;
}
function le_Sh(a) {
  return a.l
    ? le_.t("loot_filters.select_box.none")
    : le_.t("loot_filters.select_box.select");
}
function le_Wh(a, b) {
  a.find("div.item-block").each(function () {
    const c = $(this);
    c.attr("item") == b ? c.addClass("selected") : c.removeClass("selected");
  });
}
class le_Nh extends le_6 {
  constructor(a) {
    super();
    this.callbacks = a;
    this.l = !1;
  }
  V() {
    const a = this;
    a.g = $(
      `<div id="filter-details-form-overlay" class="common-overlay" style="display:none">
			<div class="common-overlay-form filter-details-form">
				<div class="form-header"></div>
				<div class="form-close-btn">
					<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#808080"><path d="m6.062 15.667-1.729-1.729L8.271 10 4.333 6.062l1.729-1.729L10 8.271l3.938-3.938 1.729 1.729L11.729 10l3.938 3.938-1.729 1.729L10 11.729Z"/></svg>
				</div>
				<div class="form-content">
					<div class="form-field" field="filter-title">
						<div class="form-field-title"></div>
						<input type="text" />
					</div>
					<div class="form-field" field="filter-description">
						<div class="form-field-title"></div>
						<textarea type="text"></textarea>
					</div>
					<div class="form-field-icons">
						<div class="form-field" field="filter-icon">
							<div class="form-field-title"></div>
							<div class="icon-selector"></div>
						</div>
						<div class="form-field" field="filter-icon-color">
							<div class="form-field-title"></div>
							<div class="icon-color-selector"></div>
						</div>
					</div>
					
					<div class="filter-details-divider-header">
						<div class="filter-details-divider-header-line"></div>
					</div>
					<div class="form-field" field="filter-privacy">
						<div class="form-field-title"></div>
						<div class="ext-select-wrapper">
							<div class="select-wrapper"></div>
							<div class="field-help-icon privacy-help">
								${le_qg()}
							</div>
						</div>
					</div>

					<div class="filter-details-optional-header">
						<div class="filter-details-optional-header-line"></div>
						<div class="filter-details-optional-header-text"></div>
						<div class="filter-details-optional-header-line"></div>
					</div>
					<div class="form-field" field="filter-tags-general">
						<div class="form-field-title"></div>
						<div class="select-wrapper"></div>
					</div>
					<div class="form-field" field="filter-tags-class">
						<div class="form-field-title"></div>
						<div class="select-wrapper"></div>
					</div>
					<div class="form-field" field="filter-tags-skill">
						<div class="form-field-title"></div>
						<div class="select-wrapper"></div>
					</div>
				</div>
				<div class="form-buttons">
					<div class="apply-btn action-cancel"></div>
					<div class="apply-btn action-save"></div>
				</div>
			</div>
		</div>`.replace(/[\t\n]/g, "")
    ).appendTo(document.body);
    a.j = a.g.find('.form-field[field="filter-title"] input');
    a.B = a.g.find('.form-field[field="filter-description"] textarea');
    a.o = a.g.find('.form-field[field="filter-icon"] .icon-selector');
    a.m = a.g.find(
      '.form-field[field="filter-icon-color"] .icon-color-selector'
    );
    a.I = a.g.find(".apply-btn.action-cancel");
    a.i = a.g.find(".apply-btn.action-save");
    le_Qh(a.g.find('.form-field[field="filter-privacy"] .select-wrapper'));
    a.D = a.g.find('.form-field[field="filter-privacy"] select');
    le_Rh(
      a,
      a.g.find('.form-field[field="filter-tags-general"] .select-wrapper')
    );
    a.J = a.g.find('.form-field[field="filter-tags-general"] select');
    le_Th(
      a,
      a.g.find('.form-field[field="filter-tags-class"] .select-wrapper')
    );
    a.A = a.g.find('.form-field[field="filter-tags-class"] select');
    le_Uh(
      a,
      a.g.find('.form-field[field="filter-tags-skill"] .select-wrapper')
    );
    a.F = a.g.find('.form-field[field="filter-tags-skill"] select');
    le_Vh(a);
    le_Xh(a);
    const b = a.g.find(".privacy-help");
    a.L = tippy(b[0], {
      theme: "plain",
      arrow: !1,
      allowHTML: !0,
      delay: [100, 0],
    });
    a.j.on("keyup", function () {
      le_Yh(a);
    });
    a.B.on("keyup", function () {
      le_Yh(a);
    });
    a.g.find(".form-close-btn").click(function () {
      a.hide(!0);
    });
    a.I.click(function () {
      a.hide(!0);
    });
    a.i.click(function () {
      if (!a.i.hasClass("disabled")) {
        const d = a.j.val().trim();
        var c = a.B.val()
          .replaceAll("www.maxroll.gg", "---")
          .replaceAll("maxroll.gg", "---")
          .replaceAll("www.icy-veins.com", "---")
          .replaceAll("icy-veins.com", "---")
          .trim();
        const f = le_Zh(a.o),
          k = le_Zh(a.m),
          n = +a.D.val(),
          m = a.J.val(),
          p = a.A.val(),
          r = a.F.val();
        a.callbacks.Nc({
          title: d,
          description: c || "",
          icon: f,
          qc: k,
          sc: n,
          Qa: m,
          hc: p,
          wc: r,
        });
        a.hide();
      }
    });
  }
  show(a) {
    super.show();
    this.j.val(a.title);
    this.B.val(a.description || "");
    le_Wh(this.o, a.icon);
    le_Wh(this.m, a.qc);
    le_1(this.D, a.sc, !0);
    le_1(this.J, a.Qa, !0);
    le_1(this.A, a.hc, !0);
    le_1(this.F, a.wc, !0);
    le_Yh(this);
    this.K();
    this.g.show();
    this.j.focus();
  }
  hide(a) {
    super.hide(a);
    this.g.hide();
  }
  isActive() {
    return this.g.is(":visible");
  }
  K() {
    this.g
      .find(".form-header")
      .text(le_.t("loot_filters.configure_form.title"));
    this.j.attr(
      "placeholder",
      le_.t("loot_filters.configure_form.fields.title.placeholder")
    );
    this.B.attr(
      "placeholder",
      le_.t("loot_filters.configure_form.fields.description.placeholder")
    );
    this.g
      .find('.form-field[field="filter-title"] .form-field-title')
      .text(le_.t("loot_filters.configure_form.fields.title"));
    this.g
      .find('.form-field[field="filter-description"] .form-field-title')
      .text(le_.t("loot_filters.configure_form.fields.description"));
    this.g
      .find('.form-field[field="filter-icon"] .form-field-title')
      .text(le_.t("loot_filters.configure_form.fields.icon"));
    this.g
      .find('.form-field[field="filter-icon-color"] .form-field-title')
      .text(le_.t("loot_filters.configure_form.fields.icon_color"));
    this.g
      .find('.form-field[field="filter-privacy"] .form-field-title')
      .text(le_.t("loot_filters.configure_form.fields.privacy"));
    this.g
      .find(".filter-details-optional-header-text")
      .text(le_.t("loot_filters.configure_form.optional_fields"));
    this.g
      .find('.form-field[field="filter-tags-general"] .form-field-title')
      .text(le_.t("loot_filters.configure_form.fields.general_tags"));
    this.g
      .find('.form-field[field="filter-tags-class"] .form-field-title')
      .text(le_.t("loot_filters.configure_form.fields.class_tags"));
    this.g
      .find('.form-field[field="filter-tags-skill"] .form-field-title')
      .text(le_.t("loot_filters.configure_form.fields.skill_tags"));
    const a = le_.t(
        "loot_filters.configure_form.fields.privacy.help_line_1",
        {},
        "filter-tooltip-highlighted"
      ),
      b = le_.t(
        "loot_filters.configure_form.fields.privacy.help_line_2",
        {},
        "filter-tooltip-highlighted"
      ),
      c = le_
        .t(
          "loot_filters.configure_form.fields.privacy.help_line_3",
          {},
          "filter-tooltip-highlighted"
        )
        .replace(/<b2>/g, "<span class='filter-tooltip-highlighted2'>")
        .replace(/<\/b2>/g, "</span>"),
      d = le_.t(
        "loot_filters.configure_form.fields.privacy.help_line_4",
        {},
        "filter-tooltip-highlighted2"
      );
    this.L.setContent(`<div>
				<div>${a}</div>
				<div style="margin-top:4px;">${b}</div>
				<div style="margin-top:4px;">${c}</div>
				<div style="margin-top:4px;color:#999">${d}</div>
			</div>`);
    this.I.text(le_.t("loot_filters.selector_form.buttons.cancel"));
    this.i.text(le_.t("loot_filters.selector_form.buttons.save"));
  }
  C() {
    this.K();
  }
}
function le__h(a, b) {
  const c = [];
  le_D.j.forEach(function (d) {
    c.push(le_5(d, le_Sd(d)));
  });
  le_2(b, c, function (d) {
    a.s.ma = +d;
    le_0h(a);
    le_1h(a);
  });
}
function le_2h(a) {
  const b = a.m;
  0 >= b.scrollTop()
    ? a.B.is(":visible") && a.B.hide()
    : a.B.is(":visible") || a.B.show();
  Math.ceil(b.scrollTop() + b.innerHeight()) >= b[0].scrollHeight
    ? a.J.is(":visible") && a.J.hide()
    : a.J.is(":visible") || a.J.show();
}
function le_3h(a, b) {
  const c = new le_4h(le_5h(a), {
    nd() {
      le_6h(a);
      le_2h(a);
    },
    Oe(d) {
      a.Zc(c, d);
      le_6h(a);
      le_2h(a);
    },
    za() {
      le_6h(a);
    },
    Me() {
      le_2h(a);
    },
    We(d, f) {
      a.ba.show(a.s, d, f, a.l);
    },
    Ve(d, f, k) {
      a.W.show(a.s, d, f, k, a.l);
    },
    Ue(d, f) {
      a.D.show(a.s, d, f, a.l);
    },
  });
  c.g.appendTo(a.m);
  c.show(a.s, b, a.l);
  a.j.push(c);
}
function le_7h(a) {
  tippy(`${a} div[data-tippy-content]`, {
    theme: "plain",
    arrow: !1,
    allowHTML: !0,
    delay: [100, 0],
  });
}
function le_5h(a) {
  const b = [];
  a.j.forEach(function (c) {
    b.push(+c.Gc.val());
  });
  return b;
}
function le_6h(a) {
  le_1h(a);
  a.j.forEach(function (b) {
    b.u instanceof le_J && le_8h(b);
    b.u instanceof le_G && le_9h(b);
  });
}
function le_1h(a) {
  const b = le_Rd(a.s);
  if (le_Jd(a.s))
    a.Ba.html(b), a.A.val(a.s.xa || ""), a.ja.addClass("custom-name");
  else {
    const c = le_Qd(a.s);
    a.g.find(".rule-default-name-wrapper .default-name").html(`${b} ${c}`);
    a.ja.removeClass("custom-name");
  }
}
function le_$h(a) {
  const b = a.g.find(".form-header");
  a.l
    ? b.text(le_.t("loot_filters.rule_form.title.readonly"))
    : null == a.o
    ? b.text(le_.t("loot_filters.rule_form.title.add"))
    : b.text(le_.t("loot_filters.rule_form.title.edit"));
}
function le_0h(a) {
  switch (a.s.ma) {
    case le_K:
      a.N.hide();
      break;
    case le_L:
      a.N.hide();
      break;
    case le_M:
      a.Aa.css("background", lootFilterRuleColors[a.s.Da].primary.lightColor),
        a.N.show();
  }
}
function le_ai(a) {
  null == a.s.Z
    ? a.Y.hide()
    : (a.Y.show(), a.G.val(a.s.Z.min), a.L.val(a.s.Z.max));
}
function le_bi(a) {
  le_ci(".panel-conditions-block");
  a.m.empty();
  a.j = [];
  a.s.qa.forEach(function (b) {
    le_3h(a, b);
  });
  le_7h(".panel-conditions-block");
}
function le_ci(a) {
  $(`${a} div[data-tippy-content]`).each(function () {
    this._tippy.destroy();
  });
}
class le_Oh extends le_6 {
  constructor(a) {
    super();
    this.s = this.o = null;
    this.callbacks = a;
    this.j = [];
    this.l = !1;
    this.ba = new le_di();
    this.W = new le_ei();
    this.D = new le_fi();
  }
  V() {
    const a = this;
    a.g = $(
      '<div id="filter-rule-form-overlay" class="common-overlay" style="display:none">\n\t\t\t<div class="common-overlay-form filter-rule-form">\n\t\t\t\t<div class="form-header"></div>\n\t\t\t\t<div class="form-close-btn">\n\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#808080"><path d="m6.062 15.667-1.729-1.729L8.271 10 4.333 6.062l1.729-1.729L10 8.271l3.938-3.938 1.729 1.729L11.729 10l3.938 3.938-1.729 1.729L10 11.729Z"/></svg>\n\t\t\t\t</div>\n\t\t\t\t<div class="form-content">\n\t\t\t\t\t<div class="form-field" field="rule-name">\n\t\t\t\t\t\t<div class="form-field-title"></div>\n\t\t\t\t\t\t<div class="rule-default-name-wrapper">\n\t\t\t\t\t\t\t<div class="default-name"></div>\n\t\t\t\t\t\t\t<div class="action-button edit-button edit-name-button"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="rule-custom-name-wrapper">\n\t\t\t\t\t\t\t<div class="input-wrapper">\n\t\t\t\t\t\t\t\t<div class="name-visibility-preview"></div>\n\t\t\t\t\t\t\t\t<input type="text" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="action-button edit-button use-default-name-button"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="rule-panel">\n\t\t\t\t\t\t<div class="left-panel">\n\t\t\t\t\t\t\t<div class="panel-header-rule"></div>\n\t\t\t\t\t\t\t<div class="form-field" field="rule-visibility">\n\t\t\t\t\t\t\t\t<div class="form-field-title"></div>\n\t\t\t\t\t\t\t\t<div class="select-wrapper"></div>\n\t\t\t\t\t\t\t\t<div class="color-select-wrapper">\n\t\t\t\t\t\t\t\t\t<div class="color-preview"></div>\n\t\t\t\t\t\t\t\t\t<div class="action-button edit-button color-select-button"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="rule-emphasize">\n\t\t\t\t\t\t\t\t<div class="checkbox-container">\n\t\t\t\t\t\t\t\t\t<div class="checkbox"></div>\n\t\t\t\t\t\t\t\t\t<div class="emphasize-text checkbox-label"></div>\n\t\t\t\t\t\t\t\t\t<div class="emphasize-description"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="rule-level-dependency">\n\t\t\t\t\t\t\t\t<div class="checkbox-container">\n\t\t\t\t\t\t\t\t\t<div class="checkbox"></div>\n\t\t\t\t\t\t\t\t\t<div class="level-dependency-text checkbox-label"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class="rule-level-dependency-input">\n\t\t\t\t\t\t\t\t\t<input type="number" min="0" max="100" value="0" class="level-min"/>\n\t\t\t\t\t\t\t\t\t<input type="number" min="0" max="100" value="100" class="level-max" />\t\n\t\t\t\t\t\t\t\t\t<div class="level-dependency-description"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="right-panel">\n\t\t\t\t\t\t\t<div class="panel-header-wrapper">\n\t\t\t\t\t\t\t\t<div class="shade-wrap" style="display:none"><div></div></div>\n\t\t\t\t\t\t\t\t<div class="panel-header-condition"></div>\n\t\t\t\t\t\t\t\t<div class="panel-header-properties"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="panel-conditions-block"></div>\n\t\t\t\t\t\t\t<div class="add-condition-button-wrapper">\n\t\t\t\t\t\t\t\t<div class="shade-wrap" style="display:none"><div></div></div>\n\t\t\t\t\t\t\t\t<div class="action-button edit-button add-condition-button"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div> \n\t\t\t\t\t</div> \n\t\t\t\t</div>\n\t\t\t\t<div class="form-buttons">\n\t\t\t\t\t<div class="apply-btn action-cancel"></div>\n\t\t\t\t\t<div class="apply-btn action-save"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>'.replace(
        /[\t\n]/g,
        ""
      )
    ).appendTo(document.body);
    a.form = a.g.find(".filter-rule-form");
    a.ja = a.g.find('.form-field[field="rule-name"]');
    a.Ba = a.g.find('.form-field[field="rule-name"] .name-visibility-preview');
    a.A = a.g.find('.form-field[field="rule-name"] input');
    a.ca = a.g.find(
      '.form-field[field="rule-name"] .action-button.edit-name-button'
    );
    a.oa = a.g.find(
      '.form-field[field="rule-name"] .action-button.use-default-name-button'
    );
    a.ga = a.g.find(
      '.form-field[field="rule-visibility"] .action-button.color-select-button'
    );
    a.N = a.g.find(
      '.form-field[field="rule-visibility"] .color-select-wrapper'
    );
    a.Aa = a.g.find('.form-field[field="rule-visibility"] .color-preview');
    a.R = a.g.find(".rule-emphasize .checkbox-container");
    a.M = a.g.find(".rule-level-dependency .checkbox-container");
    a.Y = a.g.find(".rule-level-dependency .rule-level-dependency-input");
    a.G = a.g.find('input[type="number"].level-min');
    a.L = a.g.find('input[type="number"].level-max');
    a.F = a.g.find(".color-selector");
    a.m = a.g.find(".panel-conditions-block");
    a.X = a.g.find(".action-button.add-condition-button");
    a.I = a.g.find(".apply-btn.action-cancel");
    a.i = a.g.find(".apply-btn.action-save");
    a.B = a.g.find(".right-panel .panel-header-wrapper .shade-wrap");
    a.J = a.g.find(".right-panel .add-condition-button-wrapper .shade-wrap");
    le__h(a, a.g.find('.form-field[field="rule-visibility"] .select-wrapper'));
    a.T = a.g.find('.form-field[field="rule-visibility"] select');
    a.A.change(function () {
      const b = a.A.val().trim();
      a.s.xa = b;
    });
    a.ca.click(function () {
      var b = le_Qd(a.s, !0).replace(/(<([^>]+)>)/gi, "");
      a.s.xa = b;
      le_1h(a);
    });
    a.oa.click(function () {
      a.s.xa = null;
      le_1h(a);
    });
    a.R.click(function () {
      a.l || ((a.s.Ga = !a.s.Ga), le_1h(a), le_4(a.R, a.s.Ga));
    });
    a.M.click(function () {
      a.l ||
        ((a.s.Z = null == a.s.Z ? { min: 0, max: 100 } : null),
        le_ai(a),
        le_4(a.M, null != a.s.Z));
    });
    le_mg(a.G, function (b) {
      a.s.Z.min = b;
    });
    le_mg(a.L, function (b) {
      a.s.Z.max = b;
    });
    a.fa = new le_gi({
      rc: function () {},
      Nc: function (b) {
        a.s.setColor(b);
        le_0h(a);
        le_1h(a);
      },
    });
    a.ga.click(function () {
      a.fa.show(a.s.Da, a.l);
    });
    a.X.click(function () {
      if (!a.l) {
        var b = new le_ld();
        a.s.qa.push(b);
        le_3h(a, b);
        le_2h(a);
        le_7h(
          `.panel-conditions-block .filter-rule-condition-block[condition-id="${b.O()}"]`
        );
      }
    });
    a.g.find(".form-close-btn").click(function () {
      a.hide(!0);
    });
    a.I.click(function () {
      a.hide(!0);
    });
    a.i.click(function () {
      a.l ||
        (null == a.o
          ? a.callbacks.Le(a.s)
          : (a.s.copyTo(a.o), a.callbacks.Ye(a.o)));
      a.hide();
    });
    a.m.on("scroll", function () {
      le_2h(a);
    });
  }
  show(a, b) {
    this.o = a;
    this.S(a.clone(), b);
  }
  S(a, b) {
    super.show();
    this.s = a;
    this.l = b;
    le_$h(this);
    le_1(this.T, this.s.ma, !0);
    le_4(this.R, this.s.Ga);
    le_4(this.M, null != this.s.Z);
    le_1h(this);
    le_0h(this);
    le_ai(this);
    le_bi(this);
    this.l
      ? (this.form.addClass("readonly"),
        this.A.attr("disabled", "disabled"),
        this.T.attr("disabled", "disabled"),
        this.G.attr("disabled", "disabled"),
        this.L.attr("disabled", "disabled"))
      : (this.form.removeClass("readonly"),
        this.A.removeAttr("disabled"),
        this.T.removeAttr("disabled"),
        this.G.removeAttr("disabled"),
        this.L.removeAttr("disabled"));
    this.K();
    this.g.show();
    this.m.scrollTop(0);
    le_2h(this);
  }
  hide(a = !1) {
    super.hide(a);
    this.g.hide();
  }
  isActive() {
    return this.g.is(":visible");
  }
  K() {
    this.g
      .find('.form-field[field="rule-name"] .form-field-title')
      .text(le_.t("loot_filters.rule_form.rule_name"));
    this.ca.text(le_.t("loot_filters.rule_form.buttons.edit"));
    this.oa.text(le_.t("loot_filters.rule_form.buttons.use_default"));
    this.g
      .find(".left-panel .panel-header-rule")
      .text(le_.t("loot_filters.rule_form.columns.rule"));
    this.g
      .find('.form-field[field="rule-visibility"] .form-field-title')
      .text(le_.t("loot_filters.rule_form.rule_visibility"));
    this.ga.text(
      this.l
        ? le_.t("loot_filters.rule_form.buttons.colors.view")
        : le_.t("loot_filters.rule_form.buttons.colors.edit")
    );
    this.g
      .find(".rule-emphasize .emphasize-text")
      .text(le_.t("loot_filters.rule_form.rule_emphasize"));
    this.g
      .find(".rule-emphasize .emphasize-description")
      .text(le_.t("loot_filters.rule_form.rule_emphasize.hint"));
    this.g
      .find(".rule-level-dependency .level-dependency-text")
      .text(le_.t("loot_filters.rule_form.rule_char_level_dependency"));
    this.g
      .find(".rule-level-dependency .level-dependency-description")
      .text(le_.t("loot_filters.rule_form.rule_char_level_dependency.hint"));
    this.g
      .find(".right-panel .panel-header-condition")
      .text(le_.t("loot_filters.rule_form.columns.condition"));
    this.g
      .find(".right-panel .panel-header-properties")
      .text(le_.t("loot_filters.rule_form.columns.properties"));
    this.X.text(le_.t("loot_filters.rule_form.buttons.add_condition"));
    this.A.attr(
      "placeholder",
      le_.t("loot_filters.rule_form.rule_name.placeholder")
    );
    this.m.attr(
      "data-empty-content",
      le_.t("loot_filters.rule_form.no_conditions")
    );
    this.I.text(le_.t("loot_filters.selector_form.buttons.cancel"));
    this.i.text(le_.t("loot_filters.selector_form.buttons.save"));
  }
  C() {
    this.K();
    le_$h(this);
    this.j.forEach(function (a) {
      a.P();
    });
    this.D.P();
    this.W.P();
    this.ba.P();
    this.fa.P();
  }
  Zc(a, b) {
    this.s.Zc(b);
    this.j = this.j.filter(function (c) {
      return c.u.O() !== b.O();
    });
    le_ci(
      `.panel-conditions-block .filter-rule-condition-block[condition-id="${b.O()}"]`
    );
    a.remove();
  }
}
function le_hi(a) {
  const b = [];
  lootFilterRuleColors.forEach(function (c, d) {
    const f = c.secondary.lightColor;
    b.push(`<div class="item-block" item="${d}">
				<div class="normal-text" style="color:${
          c.primary.lightColor
        };background:${c.primary.buttonColor};border:1px solid ${c.primary.borderColor};">Label Example</div>
				<div class="unique-text" style="color:${f};background:${c.secondary.buttonColor};border:1px solid ${c.secondary.borderColor};text-shadow:${"rgba(0,0,0,255)" == f ? "0 0 1px #FFF" : "0 0 1px #000"};">Label Example</div>
			</div>`);
  });
  a.F.html(b.join(""));
  a.F.find("div.item-block").click(function () {
    if (!a.l) {
      const c = $(this).attr("item");
      le_ii(a, c);
    }
  });
}
function le_ji(a) {
  let b = 0;
  a.F.find("div.item-block").each(function () {
    const c = $(this);
    c.hasClass("selected") && (b = +c.attr("item"));
  });
  return b;
}
function le_ii(a, b) {
  a.F.find("div.item-block").each(function () {
    const c = $(this);
    c.attr("item") == b ? c.addClass("selected") : c.removeClass("selected");
  });
}
class le_gi extends le_6 {
  constructor(a) {
    super();
    this.callbacks = a;
    this.l = !1;
  }
  V() {
    const a = this;
    a.g = $(
      '<div id="filter-rule-color-form-overlay" class="common-overlay" style="display:none">\n\t\t\t<div class="common-overlay-form filter-rule-color-form">\n\t\t\t\t<div class="form-header"></div>\n\t\t\t\t<div class="form-close-btn">\n\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#808080"><path d="m6.062 15.667-1.729-1.729L8.271 10 4.333 6.062l1.729-1.729L10 8.271l3.938-3.938 1.729 1.729L11.729 10l3.938 3.938-1.729 1.729L10 11.729Z"/></svg>\n\t\t\t\t</div>\n\t\t\t\t<div class="form-content">\n\t\t\t\t\t<div class="color-header">\n\t\t\t\t\t\t<div class="normal-text"></div>\n\t\t\t\t\t\t<div class="unique-text"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-selector"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class="form-buttons">\n\t\t\t\t\t<div class="apply-btn action-cancel"></div>\n\t\t\t\t\t<div class="apply-btn action-save"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>'.replace(
        /[\t\n]/g,
        ""
      )
    ).appendTo(document.body);
    a.form = a.g.find(".filter-rule-color-form");
    a.F = a.g.find(".color-selector");
    a.I = a.g.find(".apply-btn.action-cancel");
    a.i = a.g.find(".apply-btn.action-save");
    le_hi(a);
    a.g.find(".form-close-btn").click(function () {
      a.hide(!0);
    });
    a.I.click(function () {
      a.hide(!0);
    });
    a.i.click(function () {
      const b = le_ji(a);
      a.callbacks.Nc(b);
      a.hide();
    });
  }
  show(a, b) {
    super.show();
    this.l = b;
    le_ii(this, a);
    this.l ? this.form.addClass("readonly") : this.form.removeClass("readonly");
    this.K();
    this.g.show();
  }
  hide(a = !1) {
    super.hide(a);
    this.g.hide();
  }
  isActive() {
    return this.g.is(":visible");
  }
  K() {
    this.g
      .find(".form-header")
      .text(
        this.l
          ? le_.t("loot_filters.color_form.title.readonly")
          : le_.t("loot_filters.color_form.title")
      );
    this.g
      .find(".color-header .normal-text")
      .text(le_.t("loot_filters.color_form.columns.normal_exalted"));
    this.g
      .find(".color-header .unique-text")
      .text(le_.t("loot_filters.color_form.columns.unique_set"));
    this.I.text(le_.t("loot_filters.selector_form.buttons.cancel"));
    this.i.text(le_.t("loot_filters.selector_form.buttons.save"));
  }
  C() {
    this.K();
  }
}
function le_ki(a) {
  a.u.Ca ? a.ca.show() : a.ca.hide();
}
function le_li(a, b) {
  const c = [];
  le_D.o.forEach(function (d) {
    (0 != d && -1 != a.oa.indexOf(d)) || c.push(le_5(d, le_3d(d)));
  });
  le_2(b, c, function (d) {
    const f = a.u.O();
    a.u = le_6d(+d);
    a.u.U = f;
    d = a.s.qa.findIndex(function (k) {
      return k.O() == f;
    });
    -1 != d ? (a.s.qa[d] = a.u) : console.error("swapped condition not found");
    a.nd();
  });
}
function le_9h(a) {
  const b = a.u.pa;
  if (0 == b.length) a.o.text(""), a.o.addClass("empty");
  else {
    if (1 == b.length) {
      var c = le_A[b[0]];
      const d = $db.pc(c.rarityTier);
      c = $db.getItemName(c) + `<span class="affix-rarity">(${d})</span>`;
    } else
      c = le_.t("loot_filters.filter_rule.affix_condition.selected", {
        count: b.length,
      });
    le_Ud(a.s, b) || (c += le_mi());
    a.o.html(c);
    a.o.removeClass("empty");
  }
  le_1(a.M, a.u.va, !0);
  le_1(a.N, a.u.sa, !0);
}
function le_ni(a) {
  0 < a.u.pa.length
    ? (a.m.removeAttr("disabled"), a.fa.removeClass("disabled"))
    : (a.m.attr("disabled", "disabled"), a.fa.addClass("disabled"));
  const b = Math.min(a.u.pa.length, 4),
    c = Math.min(a.u.wa, Math.max(1, b));
  a.u.wa = c;
  a.m.attr("max", b);
  a.m.val(c);
}
function le_oi(a, b) {
  const c = [];
  le_D.i.forEach(function (d) {
    c.push(le_5(d, le_5d(d)));
  });
  le_2(b, c, function (d) {
    a.u.va = +d;
    le_pi(a);
    a.callbacks.za(a.u);
  });
}
function le_qi(a, b) {
  const c = [];
  le_D.i.forEach(function (d) {
    c.push(le_5(d, le_5d(d)));
  });
  le_2(b, c, function (d) {
    a.u.sa = +d;
    le_ri(a);
    a.callbacks.za(a.u);
  });
}
function le_si(a, b) {
  const c = [];
  le_D.g.forEach(function (d) {
    const f = le_Sa(d.Lb);
    c.push(le_5(d.id, f));
  });
  le_3(b, c, le_ti(a), function (d) {
    le_vd(
      a.u,
      d.map(function (f) {
        return +f;
      })
    );
    a.callbacks.za(a.u);
  });
}
function le_ui(a, b) {
  const c = [];
  le_D.m.forEach(function (d) {
    c.push(le_5(d, le_4d(d)));
  });
  le_2(b, c, function (d) {
    a.u.Ya = +d;
    le_vi(a);
    a.callbacks.za(a.u);
  });
}
function le_wi(a, b) {
  const c = [];
  le_D.l.forEach(function (d) {
    let f = le_Fd(d.id);
    c.push(le_5(d.id, le_qa(f)));
  });
  le_3(b, c, le_ti(a), function (d) {
    le_Dd(
      a.u,
      d.map(function (f) {
        return +f;
      })
    );
    a.callbacks.za(a.u);
  });
}
function le_8h(a) {
  var b = a.u.ra;
  const c = a.u.Ea;
  if (0 == b.length) a.C.text(""), a.C.addClass("empty");
  else {
    var d =
      1 == b.length
        ? le_d(itemDB.itemList.equippable[b[0]])
        : le_.t("loot_filters.filter_rule.item_type_condition.selected", {
            count: b.length,
          });
    a.C.text(d);
    a.C.removeClass("empty");
  }
  if (0 == b.length || 1 < b.length)
    a.j.text(""), a.j.addClass("disabled"), a.j.addClass("empty");
  else if (0 == c.length)
    a.j.text(""), a.j.removeClass("disabled"), a.j.addClass("empty");
  else {
    b = b[0];
    d = itemDB.itemList.equippable[b];
    if (1 == c.length) {
      d = d.subItems[c[0]];
      const f = $db.getLevelRequirement(d);
      d = le_d(d) + `<span class="item-lvl">(ilvl ${f})</span>`;
    } else
      d = le_.t("loot_filters.filter_rule.item_type_condition.selected", {
        count: c.length,
      });
    le_Td(a.s, b, c) || (d += le_mi());
    a.j.html(d);
    a.j.removeClass("disabled");
    a.j.removeClass("empty");
  }
}
function le_xi(a) {
  a.u instanceof le_G
    ? (le_9h(a), le_ni(a), le_ki(a), le_pi(a), le_ri(a))
    : a.u instanceof le_H
    ? le_1(a.T, a.u.ua, !0)
    : a.u instanceof le_xd
    ? (le_1(a.S, a.u.Ya, !0), a.I.val(a.u.Xa), le_vi(a))
    : a.u instanceof le_I
    ? le_1(a.Y, a.u.Ma, !0)
    : a.u instanceof le_J && le_8h(a);
}
function le_yi(a) {
  a.u instanceof le_G ? (a.A.show(), le_4(a.A, a.u.Ca)) : a.A.hide();
}
function le_zi(a) {
  a.g.find(".property-panel").each(function () {
    const b = $(this),
      c = +b.attr("condition");
    a.u.Ua == c ? b.show() : b.hide();
  });
}
function le_pi(a) {
  a.u.va != le_F
    ? (a.R.css("visibility", "visible"),
      a.ja.css("visibility", "visible"),
      a.R.text(le_sd(a.u.va)))
    : (a.R.css("visibility", "hidden"), a.ja.css("visibility", "hidden"));
  const b = Math.max(a.u.La, 1);
  a.u.La = b;
  a.F.val(b);
}
function le_ri(a) {
  a.u.sa != le_F
    ? (a.W.css("visibility", "visible"),
      a.ga.css("visibility", "visible"),
      a.W.text(le_sd(a.u.sa)))
    : (a.W.css("visibility", "hidden"), a.ga.css("visibility", "hidden"));
  const b = Math.max(1, Math.min(a.u.Fa, 28));
  a.u.Fa = b;
  a.J.attr("max", 28);
  a.J.val(b);
}
function le_vi(a) {
  a.u.Ya != le_Cd
    ? (a.I.css("visibility", "visible"), a.Ta.css("visibility", "visible"))
    : (a.I.css("visibility", "hidden"), a.Ta.css("visibility", "hidden"));
}
function le_ti(a) {
  return a.l
    ? le_.t("loot_filters.select_box.none")
    : le_.t("loot_filters.select_box.select");
}
function le_mi() {
  return '<div class="filter-restrictions-warning-icon"><svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg></div>';
}
class le_4h extends le_sg {
  constructor(a, b) {
    super();
    this.oa = a;
    this.callbacks = b;
    this.l = !1;
    this.V();
  }
  V() {
    const a = this;
    a.g = $(
      `<div class="filter-rule-condition-block">
			<div class="condition-panel">
				<div class="select-wrapper"></div>
				<div class="checkbox-container advanced-options" style="display: none">
					<div class="checkbox"></div>
					<div class="advanced-options-text checkbox-label"></div>
				</div>
			</div>
			<div class="properties-panel">
				<div class="property-panel" condition="${le_ud}">
					<div class="affix-panel">
						<div class="property-title"></div>
						<div class="property-value affix-select"></div>
					</div>
					<div class="affix-count-panel">
						<div class="property-title with-affixes-prefix"></div>
						<div class="property-value affix-count-input">
							<input type="number" value="1" min="1" max="1" class="affix-count-value" />
						</div>
					</div>
					<div class="affix-advanced-panel" style="display:none">
						<div class="affix-advanced-header">
							<div class="affix-advanced-header-line"></div>
							<div class="affix-advanced-header-text"></div>
							<div class="affix-advanced-header-line"></div>
						</div>
						<div class="affix-individual-tiers-header"></div>
						<div class="affix-individual-tiers-subheader"></div>
						<div class="affix-individual-tiers">
							<div class="property-value tier-comparison-select">
								<div class="select-wrapper"></div>
							</div>
							<div class="property-title tier-comparison-text"></div>
							<div class="property-value tier-count-input">
								<input type="number" value="1" min="1" max="7" class="affix-count-value" />
							</div>
						</div>
						<div class="affix-total-tiers-header"></div>
						<div class="affix-total-tiers-subheader"></div>
						<div class="affix-total-tiers">
							<div class="property-value tier-comparison-select">
								<div class="select-wrapper"></div>
							</div>
							<div class="property-title tier-comparison-text"></div>
							<div class="property-value tier-count-input">
								<input type="number" value="1" min="1" max="1" class="affix-count-value" />
							</div>
						</div>
						<div class="affix-total-tiers-warning"></div>
					</div>
				</div>
				<div class="property-panel" condition="${le_wd}">
					<div class="property-title"></div>
					<div class="property-value class-select">
						<div class="select-wrapper"></div>
					</div>
				</div>
				<div class="property-panel" condition="${le_zd}">
					<div class="property-value level-type-select">
						<div class="select-wrapper"></div>
					</div>
					<div class="property-title level-label"></div>
					<div class="property-value level-input">
						<input type="number" min="0" max="100" value="0" />
					</div>
				</div>
				<div class="property-panel" condition="${le_Ed}">
					<div class="property-title"></div>
					<div class="property-value rarity-select">
						<div class="select-wrapper"></div>
					</div>
				</div>
				<div class="property-panel" condition="${le_Hd}">
					<div class="item-type-panel">
						<div class="property-title"></div>
						<div class="property-value item-type-select"></div>
					</div>
					<div class="item-subtype-panel">
						<div class="property-title"></div>
						<div class="property-value item-subtype-select"></div>
					</div>
				</div>
			</div>
			<div class="delete-condition-button-wrapper">
				<div class="delete-condition-button" data-tippy-content="">
					<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="m339-288 141-141 141 141 51-51-141-141 141-141-51-51-141 141-141-141-51 51 141 141-141 141 51 51ZM480-96q-79 0-149-30t-122.5-82.5Q156-261 126-331T96-480q0-80 30-149.5t82.5-122Q261-804 331-834t149-30q80 0 149.5 30t122 82.5Q804-699 834-629.5T864-480q0 79-30 149t-82.5 122.5Q699-156 629.5-126T480-96Z"></path></svg> 
				</div>
		    </div>
		</div>`.replace(/[\t\n]/g, "")
    );
    a.B = a.g.find(".delete-condition-button");
    a.A = a.g.find(".condition-panel .advanced-options");
    a.i = a.g.find(`.property-panel[condition="${le_ud}"]`);
    a.ca = a.g.find(
      `.property-panel[condition="${le_ud}"] .affix-advanced-panel`
    );
    a.ba = a.g.find(`.property-panel[condition="${le_wd}"]`);
    a.D = a.g.find(`.property-panel[condition="${le_zd}"]`);
    a.X = a.g.find(`.property-panel[condition="${le_Ed}"]`);
    a.G = a.g.find(`.property-panel[condition="${le_Hd}"]`);
    a.B.click(function () {
      a.l || (a.g.remove(), a.callbacks.Oe(a.u));
    });
    a.A.click(function () {
      a.l ||
        ((a.u.Ca = !a.u.Ca), le_ki(a), le_4(a.A, a.u.Ca), a.callbacks.Me());
    });
    le_li(a, a.g.find(".condition-panel .select-wrapper"));
    a.Gc = a.g.find(".condition-panel select");
    a.o = a.i.find(".affix-select");
    a.fa = a.i.find(".affix-count-panel");
    a.m = a.i.find(".affix-count-input input");
    a.R = a.i.find(".affix-individual-tiers .tier-comparison-text");
    a.ja = a.i.find(".affix-individual-tiers .tier-count-input");
    a.F = a.i.find(".affix-individual-tiers .tier-count-input input");
    a.W = a.i.find(".affix-total-tiers .tier-comparison-text");
    a.ga = a.i.find(".affix-total-tiers .tier-count-input");
    a.J = a.i.find(".affix-total-tiers .tier-count-input input");
    a.L = a.i.find(".affix-total-tiers-warning");
    a.o.click(function () {
      a.callbacks.Ue(a.u.pa, {
        fb: function (b) {
          a.u.pa = b;
          le_9h(a);
          le_ni(a);
          a.callbacks.za(a.u);
        },
      });
    });
    le_mg(a.m, function (b) {
      a.u.wa = b;
      a.callbacks.za(a.u);
    });
    le_oi(a, a.i.find(".affix-individual-tiers .select-wrapper"));
    le_qi(a, a.i.find(".affix-total-tiers .select-wrapper"));
    le_mg(a.F, function (b) {
      a.u.La = b;
      a.callbacks.za(a.u);
    });
    le_mg(a.J, function (b) {
      a.u.Fa = b;
      b = a.u;
      b =
        22 < b.Fa
          ? {
              text: "Notice: Items with that mAny combined tiers are extremely rare",
              Kb: "error-text",
            }
          : 16 < b.Fa
          ? {
              text: "Notice: Items with that many combined tiers are rare",
              Kb: "warning-text",
            }
          : null;
      a.u.sa != le_F && b
        ? (a.L.attr("class", `affix-total-tiers-warning ${b.Kb}`),
          a.L.html(le_mi() + b.text),
          a.L.css("visibility", "visible"))
        : a.L.css("visibility", "hidden");
      a.callbacks.za(a.u);
    });
    a.M = a.i.find(".affix-individual-tiers select");
    a.N = a.i.find(".affix-total-tiers select");
    le_si(a, a.ba.find(".class-select .select-wrapper"));
    a.T = a.ba.find("select");
    a.Ta = a.D.find(".level-label");
    a.I = a.D.find(".level-input input");
    le_ui(a, a.D.find(".level-type-select .select-wrapper"));
    le_mg(a.I, function (b) {
      a.u.Xa = b;
      a.callbacks.za(a.u);
    });
    a.S = a.D.find("select");
    le_wi(a, a.X.find(".rarity-select .select-wrapper"));
    a.Y = a.X.find("select");
    a.C = a.G.find(".item-type-select");
    a.j = a.G.find(".item-subtype-select");
    a.C.click(function () {
      a.callbacks.We(a.u.ra, {
        fb: function (b) {
          a.u.ra = b;
          a.u.Ea = [];
          le_8h(a);
          a.callbacks.za(a.u);
        },
      });
    });
    a.j.click(function () {
      $(this).hasClass("disabled") ||
        a.callbacks.Ve(a.u.ra[0], a.u.Ea, {
          fb: function (b) {
            a.u.Ea = b;
            le_8h(a);
            a.callbacks.za(a.u);
          },
        });
    });
  }
  show(a, b, c) {
    this.s = a;
    this.u = b;
    this.l = c;
    this.g.attr("condition-id", this.u.O());
    le_1(this.Gc, this.u.Ua, !0);
    le_xi(this);
    le_yi(this);
    le_zi(this);
    this.l
      ? (this.Gc.attr("disabled", "disabled"),
        this.m.attr("disabled", "disabled"),
        this.M.attr("disabled", "disabled"),
        this.F.attr("disabled", "disabled"),
        this.N.attr("disabled", "disabled"),
        this.J.attr("disabled", "disabled"),
        this.T.attr("disabled", "disabled"),
        this.S.attr("disabled", "disabled"),
        this.I.attr("disabled", "disabled"),
        this.Y.attr("disabled", "disabled"))
      : (this.Gc.removeAttr("disabled"),
        this.m.removeAttr("disabled"),
        this.M.removeAttr("disabled"),
        this.F.removeAttr("disabled"),
        this.N.removeAttr("disabled"),
        this.J.removeAttr("disabled"),
        this.T.removeAttr("disabled"),
        this.S.removeAttr("disabled"),
        this.I.removeAttr("disabled"),
        this.Y.removeAttr("disabled"));
    this.K();
  }
  remove() {
    this.g.remove();
  }
  nd() {
    le_xi(this);
    le_yi(this);
    le_zi(this);
    this.callbacks.nd(this.u);
  }
  K() {
    this.g
      .find(".condition-panel .advanced-options-text")
      .text(
        le_.t("loot_filters.filter_rule.affix_condition.advanced.checkbox")
      );
    this.i
      .find(".affix-panel .property-title")
      .text(le_.t("loot_filters.filter_rule.affix_condition.title"));
    this.i
      .find(".affix-advanced-header-text")
      .text(
        le_.t("loot_filters.filter_rule.affix_condition.advanced.category")
      );
    this.i
      .find(".affix-count-panel .with-affixes-prefix")
      .text(
        le_.t(
          "loot_filters.filter_rule.affix_condition.minimum_number_of_affixes"
        )
      );
    this.i
      .find(".affix-individual-tiers-header")
      .text(le_.t("loot_filters.filter_rule.affix_condition.tiers.header"));
    this.i
      .find(".affix-individual-tiers-subheader")
      .text(le_.t("loot_filters.filter_rule.affix_condition.tiers.subheader"));
    this.i
      .find(".affix-total-tiers-header")
      .text(
        le_.t("loot_filters.filter_rule.affix_condition.total_tiers.header")
      );
    this.i
      .find(".affix-total-tiers-subheader")
      .text(
        le_.t("loot_filters.filter_rule.affix_condition.total_tiers.subheader")
      );
    this.ba
      .find(".property-title")
      .text(le_.t("loot_filters.filter_rule.class_condition.title"));
    this.D.find(".level-label").text(
      le_.t("loot_filters.filter_rule.level_condition.title")
    );
    this.X.find(".property-title").text(
      le_.t("loot_filters.filter_rule.rarity_condition.title")
    );
    this.G.find(".item-type-panel .property-title").text(
      le_.t("loot_filters.filter_rule.item_type_condition.type")
    );
    this.G.find(".item-subtype-panel .property-title").text(
      le_.t("loot_filters.filter_rule.item_type_condition.subtypes")
    );
    const a = le_.t("loot_filters.select_box.select"),
      b = le_.t(
        "loot_filters.filter_rule.item_type_condition.subtypes_placeholder"
      );
    this.o.attr("data-empty-content", a);
    this.C.attr("data-empty-content", a);
    this.j.attr("data-empty-content", a);
    this.j.attr("data-not-allowed-content", b);
    this.B.attr(
      "data-tippy-content",
      le_.t("loot_filters.filter_rule.buttons.delete.hint")
    );
  }
  P() {
    this.K();
    le_xi(this);
  }
}
function le_Ph(a) {
  le_Ai(a);
  le_Bi(a);
}
function le_Dh(a, b, c = -1) {
  -1 == c
    ? a.g.prependTo(b)
    : a.g.insertAfter(b.find(`.filter-rule-row:nth-child(${c + 1})`));
}
function le_Ci(a) {
  a.s.Va
    ? (a.i.html(
        '<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M216-144q-29.7 0-50.85-21.15Q144-186.3 144-216v-528q0-29.7 21.15-50.85Q186.3-816 216-816h528q29.7 0 50.85 21.15Q816-773.7 816-744v528q0 29.7-21.15 50.85Q773.7-144 744-144H216Zm0-72h528v-528H216v528Z"/></svg>'
      ),
      a.g.addClass("rule-disabled"))
    : (a.i.html(
        '<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M216-144q-29.7 0-50.85-21.15Q144-186.3 144-216v-528q0-29.7 21.15-50.85Q186.3-816 216-816h528.247q7.547 0 14.15 2Q765-812 771-810l-66 66H216v528h528v-233l72-72v305q0 29.7-21.15 50.85Q773.7-144 744-144H216Zm265-144L265-505l51-51 165 166 333-332 51 51-384 383Z"/></svg>'
      ),
      a.g.removeClass("rule-disabled"));
}
function le_Ai(a) {
  const b = le_Rd(a.s),
    c = le_Jd(a.s)
      ? a.s.xa
          .replace(/&/g, "&amp;")
          .replace(/</g, "&lt;")
          .replace(/>/g, "&gt;")
      : le_Qd(a.s);
  var d = "";
  if (null != a.s.Z) {
    d = a.s.Z.min;
    const f = a.s.Z.max;
    d = `<div class="rule-restrictions">${le_.t(
      "loot_filters.rule_row.character_levels"
    )} ${d}<span>-</span>${f}</div>`;
  }
  a.C.html(`<div class="rule-name">${b} ${c}</div>` + d);
}
function le_Bi(a) {
  var b = a.s,
    c = le_Pd(b),
    d = le_Kd(b);
  let f = !0;
  if (f && c) {
    const k = c.ra;
    c = c.Ea;
    1 == k.length && 0 < c.length && (f = le_Td(b, k[0], c));
  }
  f && d && ((d = d.pa), 0 < d.length && (f = le_Ud(b, d)));
  f ? a.j.hide() : a.j.show();
}
class le_Bh {
  constructor(a) {
    this.callbacks = a;
    this.s = null;
    this.V();
  }
  V() {
    const a = this;
    a.g = $(
      '<div class="filter-rule-row">\n\t\t\t<div class="rule-drag-handle"><div></div></div>\n\t\t\t<div class="rule-button rule-button-enable"></div>\n\t\t\t<div class="rule-name-wrapper"></div>\n\t\t\t<div class="rule-buttons">\n\t\t\t\t<div class="rule-button rule-button-duplicate">\n\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M712-192h-400q-29 0-50.5-21.5t-21.5-50.5v-514q0-29 21.5-50.5t50.5-21.5h400q29 0 50.5 21.5t21.5 50.5v514q0 29-21.5 50.5t-50.5 21.5ZM168-48q-29 0-50.5-21.5T96-120v-552h72v552h456v72H168Z"/></svg>\n\t\t\t\t</div>\n\t\t\t\t<div class="rule-button rule-button-copy">\n\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M320-556v72h292l-52 52 52 52 140-140-140-140-52 52 52 52ZM712-192h-400q-29 0-50.5-21.5t-21.5-50.5v-514q0-29 21.5-50.5t50.5-21.5h400q29 0 50.5 21.5t21.5 50.5v514q0 29-21.5 50.5t-50.5 21.5ZM168-48q-29 0-50.5-21.5T96-120v-552h72v552h456v72H168Z"/></svg>\n\t\t\t\t</div>\n\t\t\t\t<div class="rule-button rule-button-delete">\n\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="m339-288 141-141 141 141 51-51-141-141 141-141-51-51-141 141-141-141-51 51 141 141-141 141 51 51ZM480-96q-79 0-149-30t-122.5-82.5Q156-261 126-331T96-480q0-80 30-149.5t82.5-122Q261-804 331-834t149-30q80 0 149.5 30t122 82.5Q804-699 834-629.5T864-480q0 79-30 149t-82.5 122.5Q699-156 629.5-126T480-96Z"/></svg>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="filter-restrictions-warning-icon" style="display:none">\n\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>\n\t\t\t</div>\n\t\t</div>'.replace(
        /[\t\n]/g,
        ""
      )
    );
    a.C = a.g.find(".rule-name-wrapper");
    a.i = a.g.find(".rule-button.rule-button-enable");
    a.o = a.g.find(".rule-button.rule-button-duplicate");
    a.m = a.g.find(".rule-button.rule-button-copy");
    a.B = a.g.find(".rule-button.rule-button-delete");
    a.j = a.g.find(".filter-restrictions-warning-icon");
    a.i.click(function () {
      a.l || ((a.s.Va = !a.s.Va), le_Ci(a), a.callbacks.Ne(a.s));
    });
    a.o.click(function () {
      a.callbacks.Re(a.s);
    });
    a.m.click(function () {
      a.callbacks.Pe(a.s);
    });
    a.B.mousedown(function (b) {
      b.preventDefault();
      b.stopPropagation();
    });
    a.B.click(function () {
      a.callbacks.Qe(a.s, le_Di);
    });
    a.C.click(function () {
      a.callbacks.Ze(a.s);
    });
  }
  show(a, b) {
    this.s = a;
    this.l = b;
    this.g.attr("rule-id", this.s.O());
    le_Ai(this);
    le_Bi(this);
    le_Ci(this);
    this.K();
  }
  remove() {
    this.g.remove();
  }
  K() {
    this.l ||
      this.i.attr(
        "data-tippy-content",
        le_.t("loot_filters.rule_row.buttons.enable_disable.hint")
      );
    this.o.attr(
      "data-tippy-content",
      le_.t("loot_filters.rule_row.buttons.duplicate.hint")
    );
    var a = le_.t("loot_filters.rule_row.buttons.copy.hint_line_1"),
      b = le_.t("loot_filters.rule_row.buttons.copy.hint_line_2");
    this.m.attr(
      "data-tippy-content",
      `<div>${a}</div><div class='filter-tooltip-extra'>${b}</div>`
    );
    a = le_.t("loot_filters.rule_row.buttons.delete.hint_line_1");
    b = le_.t("loot_filters.rule_row.buttons.delete.hint_line_2");
    this.B.attr(
      "data-tippy-content",
      `<div>${a}</div><div class='filter-tooltip-extra'>${b}</div>`
    );
    this.j.attr(
      "data-tippy-content",
      le_.t("loot_filters.rule_row.warning_icon.hint")
    );
  }
  P() {
    this.K();
  }
}
function le_Kh(a, b) {
  a.i = b;
  const c = { eb: [], Yd: {}, $d: {}, Rd: {}, Qd: 0, Zd: {}, Kd: 0, Ud: [] };
  le_Hh(a);
  for (var d = 0; 1e3 > d && !(20 <= c.eb); d++) {
    var f = le_ee();
    le_Ei(c, b, f);
  }
  for (d = 0; 100 > d && !(10 <= c.eb); d++) (f = le_ge()), le_Ei(c, b, f);
  for (d = 0; 100 > d && !(25 <= c.eb); d++) (f = le_fe()), le_Ei(c, b, f);
  for (d = 0; 10 > d && !(30 <= c.eb); d++)
    le_Ei(c, b, { item: le_ce(le_ie.i) });
  for (d = 0; 10 > d && !(35 <= c.eb); d++)
    le_Ei(c, b, { item: le_ce(le_ie.g) });
  le_Fi(c, b);
  c.eb.forEach(function (k) {
    const n = k.Kc;
    k = k.s;
    const m = le_je(k, n).appendTo(a.l);
    le_Gi(a, m, n);
    if (k) {
      const p = $(`.filter-rule-row[rule-id="${k.O()}"]`);
      m.click(function () {
        p[0] && p[0].scrollIntoView({ block: "nearest" });
        p.removeClass("filter-rule-matched-animated");
        setTimeout(function () {
          p.addClass("filter-rule-matched-animated");
        });
      });
      m.mouseover(function () {
        p.addClass("filter-rule-matched");
      });
      m.mouseout(function () {
        p.removeClass("filter-rule-matched filter-rule-matched-animated");
      });
    }
  });
}
function le_Hh(a) {
  a = a.l.find(".simulated-item");
  a.each(function (b, c) {
    (b = $(c)[0]._tippy) && b.destroy();
  });
  a.remove();
}
function le_Ei(a, b, c) {
  c = $db.Dc(c);
  if (
    !(
      le_Hi < c.levelRequirement ||
      (c.minimumDropLevel && le_Hi < c.minimumDropLevel)
    )
  ) {
    var d = b.match(c, le_Hi);
    b = d.ke;
    if (d.wd || d.xd || null != b) {
      if (b)
        if (((d = b.O()), b.ma == le_M)) {
          var f = a.Yd[d] || 0;
          if (0 < f) return;
          f++;
          a.Yd[d] = f;
          d = b.Da;
          f = a.Zd[d] || 0;
          if (1 < f) return;
          f++;
          a.Zd[d] = f;
        } else if (b.ma == le_L) {
          f = a.Rd[d] || 0;
          if (0 < f) return;
          f++;
          a.Rd[d] = f;
          if (3 < a.Qd) return;
          a.Qd++;
        } else {
          if (b.ma == le_K) {
            f = $db.getItemRarity(c);
            let k = a.$d[d] || [];
            if (k.includes(f)) return;
            k.push(f);
            a.$d[d] = k;
          }
        }
      else if (d.Ce) {
        d = $db.getItemRarity(c);
        if (a.Ud.includes(d)) return;
        a.Ud.push(d);
      } else if (d.Ae) {
        if (0 < a.Kd) return;
        a.Kd++;
      }
      a.eb.push({ Kc: c, s: b });
    }
  }
}
function le_Fi(a, b) {
  const c = {};
  b.da.forEach(function (d, f) {
    c[d.O()] = f + 1;
  });
  a.eb.sort(function (d, f) {
    return (
      ((d.s ? c[d.s.O()] : null) || 1e3) - ((f.s ? c[f.s.O()] : null) || 1e3)
    );
  });
}
function le_Gi(a, b, c) {
  var d = $db.oc(c);
  const f = $db.getItemClass(c);
  c = $db.formatItemCard(c, f, []);
  d = $('<div class="item-card ' + d + '">' + c + "</div>");
  le_mb.g(d);
  le_Wc(a.o, b, d);
}
class le_Lh {
  constructor() {
    const a = this;
    a.form = $(".filter-simulation");
    a.l = a.form.find(".simulation-preview");
    a.m = a.form.find(".simulation-header .header-text");
    a.sb = a.form.find(".rebuild-preview-button");
    a.j = a.form.find(".simulation-char-level .form-field-title");
    a.g = a.form.find(".simulation-char-level input");
    a.o = new le_Xc();
    const b = a.g[0];
    a.g.on(
      "input",
      le_xg(function () {
        const c = Math.min(parseInt(b.max), parseInt(b.value) || 0);
        le_Hi = b.value = c;
        a.i && le_Kh(a, a.i);
      }, 100)
    );
  }
  K() {
    this.m.text(le_.t("loot_filters.preview_panel.title"));
    this.sb.text(le_.t("loot_filters.preview_panel.buttons.rebuild"));
    this.j.text(le_.t("loot_filters.preview_panel.char_level"));
  }
  P() {
    this.K();
  }
}
function le_Ii(a) {
  const b = new le_xf().nc(a.i);
  le_8a(
    b,
    function () {
      console.log("Filter copied successfully!");
      a.l.show();
      setTimeout(function () {
        a.l.hide();
      }, 1e3);
    },
    function () {}
  );
}
function le_Ji(a) {
  const b = new le_xf().nc(a.i);
  le_$d(
    a.i.Na,
    new Blob([b], { type: "text/xml" }),
    function () {
      console.log("Filter saved successfully!");
      a.j.show();
      setTimeout(function () {
        a.j.hide();
      }, 1e3);
    },
    function () {}
  );
}
class le_Mh extends le_6 {
  constructor() {
    super();
    this.callbacks = void 0;
  }
  V() {
    const a = this;
    a.g = $(
      '<div id="filter-export-form-overlay" class="common-overlay" style="display:none">\n\t\t\t<div class="common-overlay-form filter-export-form">\n\t\t\t\t<div class="form-header"></div>\n\t\t\t\t<div class="form-close-btn">\n\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#808080"><path d="m6.062 15.667-1.729-1.729L8.271 10 4.333 6.062l1.729-1.729L10 8.271l3.938-3.938 1.729 1.729L11.729 10l3.938 3.938-1.729 1.729L10 11.729Z"/></svg>\n\t\t\t\t</div>\n\t\t\t\t<div class="form-content">\n\t\t\t\t\t<div class="option-block">\n\t\t\t\t\t\t<div class="action-button edit-button action-copy-to-clipboard" data-tippy-content=""></div>\n\t\t\t\t\t\t<div class="option-description">\n\t\t\t\t\t\t\t<div class="copy-to-clipboard-hint-1"></div>\n\t\t\t\t\t\t\t<div class="copy-to-clipboard-hint-2"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="option-divider"><div></div></div>\n\t\t\t\t\t<div class="option-block">\n\t\t\t\t\t\t<div class="action-button edit-button action-save-to-file" data-tippy-content=""></div>\n\t\t\t\t\t\t<div class="option-description">\n\t\t\t\t\t\t\t<div class="save-to-file-hint-1"></div>\n\t\t\t\t\t\t\t<div class="save-to-file-hint-2" style="margin-top:8px"></div>\n\t\t\t\t\t\t\t<div class="save-to-file-hint-3 code"></div>\n\t\t\t\t\t\t\t<div class="save-to-file-hint-4"></div>\n\t\t\t\t\t\t\t<div class="save-to-file-hint-5 code"></div>\n\t\t\t\t\t\t\t<div class="save-to-file-hint-6"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>'.replace(
        /[\t\n]/g,
        ""
      )
    ).appendTo(document.body);
    a.m = a.g.find(".action-button.action-copy-to-clipboard");
    a.o = a.g.find(".action-button.action-save-to-file");
    a.g.find(".form-close-btn").click(function () {
      a.hide(!0);
    });
    a.l = tippy(".action-copy-to-clipboard", {
      theme: "plain-condensed",
      placement: "top",
      arrow: !1,
      trigger: "",
    })[0];
    a.j = tippy(".action-save-to-file", {
      theme: "plain-condensed",
      placement: "top",
      arrow: !1,
      trigger: "",
    })[0];
    a.m.click(function () {
      le_Ii(a);
    });
    a.o.click(function () {
      le_Ji(a);
    });
  }
  show(a) {
    super.show();
    this.i = a;
    this.K();
    this.g.show();
  }
  hide(a = !1) {
    super.hide(a);
    this.g.hide();
  }
  isActive() {
    return this.g.is(":visible");
  }
  K() {
    this.g.find(".form-header").text(le_.t("loot_filters.export_form.title"));
    this.m.text(le_.t("loot_filters.export_form.copy_to_clipboard"));
    this.g
      .find(".copy-to-clipboard-hint-1")
      .html(le_.t("loot_filters.export_form.copy_to_clipboard.hint_line_1"));
    this.g
      .find(".copy-to-clipboard-hint-2")
      .html(
        le_.t(
          "loot_filters.export_form.copy_to_clipboard.hint_line_2",
          {},
          "highlighted"
        )
      );
    this.o.text(le_.t("loot_filters.export_form.save_to_file"));
    this.g
      .find(".save-to-file-hint-1")
      .html(
        le_.t(
          "loot_filters.export_form.save_to_file.hint_line_1",
          {},
          "highlighted"
        )
      );
    this.g
      .find(".save-to-file-hint-2")
      .html(le_.t("loot_filters.export_form.save_to_file.hint_line_2"));
    this.g
      .find(".save-to-file-hint-3")
      .html(
        "<span class='code-placeholder'>[STEAM_GAME_FOLDER]</span>/steamapps/userdata/<span class='code-placeholder'>[STEAM_USER_ID]</span>/899770/ac/WinAppDataLocalLow/Eleventh Hour Games/Last Epoch/Filters/"
      );
    this.g
      .find(".save-to-file-hint-4")
      .html(le_.t("loot_filters.export_form.save_to_file.hint_line_3"));
    this.g
      .find(".save-to-file-hint-5")
      .html(
        "<span class='code-placeholder'>[DRIVE]</span>:/Users/<span class='code-placeholder'>[USER_NAME]</span>/AppData/LocalLow/Eleventh Hour Games/Last Epoch/Filters/"
      );
    this.g
      .find(".save-to-file-hint-6")
      .html(
        le_.t(
          "loot_filters.export_form.save_to_file.hint_line_4",
          {},
          "highlighted"
        )
      );
    this.l.setContent(le_.t("loot_filters.export_form.status.copied"));
    this.j.setContent(le_.t("loot_filters.export_form.status.saved"));
  }
  C() {
    super.C();
  }
}
function le_Ki(a) {
  le_6a(
    function (b) {
      console.log("Cipboard read successfully!");
      le_$e(b, {
        pd: function (c) {
          console.log("Filter imported successfully");
          c.Uc = 2;
          le_Li(a, c);
        },
        od: function () {
          alert(a.M);
        },
        Vd: function () {},
      });
    },
    function () {}
  );
}
function le_Mi(a) {
  a.l = $("#loot-filter-import");
  a.i = $("#loot-filter-form")[0];
  a.l.change(function () {
    const b = a.l[0].files[0];
    b &&
      le_8e(b, {
        pd: function (c) {
          a.i.reset();
          console.log("Filter imported successfully");
          c.Uc = 1;
          le_Li(a, c);
        },
        od: function () {
          a.i.reset();
          alert(a.F);
        },
        Vd: function (c) {
          console.error(c);
          a.i.reset();
          alert(a.F);
        },
      });
  });
}
function le_Li(a, b) {
  le_Ni(a, !0, le_.t("loot_filters.import_form.creating_indicator"));
  b = a.W.nc(b);
  le__f(
    b,
    function (c) {
      console.log("Filter added successfully");
      le_Ni(a, !1);
      a.callbacks.Se(c);
      a.hide();
    },
    function () {
      le_Ni(a, !1);
    }
  );
}
function le_Ni(a, b, c) {
  b ? (a.J.find("div").text(c || ""), a.J.show()) : a.J.hide();
}
class le_9f extends le_6 {
  constructor(a) {
    super();
    const b = this;
    b.callbacks = a;
    b.locked = !1;
    b.W = new le_Ef();
    b.G = new le_Nh({
      rc: function () {},
      Nc: function (c) {
        c = new le_Vd(
          null,
          c.title,
          c.description,
          `${c.icon},${c.qc}`,
          [],
          1,
          Date.now(),
          Date.now(),
          gameVersion,
          myUserId,
          c.hc,
          c.wc,
          c.Qa,
          c.sc,
          0,
          null
        );
        le_Li(b, c);
      },
    });
    b.B = new le_Oi({
      rc: function () {},
      qd: function (c) {
        le_Li(b, c);
      },
    });
    b.I = new le_Pi({
      rc: function () {},
      qd: function (c) {
        le_Li(b, c);
      },
    });
  }
  V() {
    const a = this;
    a.g = $(
      '<div id="filter-import-form-overlay" class="common-overlay" style="display:none">\n\t\t\t<div class="common-overlay-form filter-import-form">\n\t\t\t\t<div class="form-header"></div>\n\t\t\t\t<div class="form-close-btn">\n\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#808080"><path d="m6.062 15.667-1.729-1.729L8.271 10 4.333 6.062l1.729-1.729L10 8.271l3.938-3.938 1.729 1.729L11.729 10l3.938 3.938-1.729 1.729L10 11.729Z"/></svg>\n\t\t\t\t</div>\n\t\t\t\t<div class="locked-overlay centered" style="display:none">\n\t\t\t\t\t<div class="message"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class="form-content">\n\t\t\t\t\t<div class="loading-overlay" style="display:none"><div></div></div>\n\t\t\t\t\t<div class="option-block">\n\t\t\t\t\t\t<div class="action-button edit-button action-create-from-scratch"></div>\n\t\t\t\t\t\t<div class="option-description">\n\t\t\t\t\t\t\t<div class="create-from-scratch-hint-1"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="option-divider"><div></div></div>\n\t\t\t\t\t<div class="option-block">\n\t\t\t\t\t\t<div class="action-button edit-button action-import-from-file"></div>\n\t\t\t\t\t\t<div class="option-description">\n\t\t\t\t\t\t\t<div class="import-from-file-hint-1"></div>\n\t\t\t\t\t\t\t<div class="import-from-file-hint-2"></div>\n\t\t\t\t\t\t\t<div class="import-from-file-hint-3"></div>\n\t\t\t\t\t\t\t<div class="import-from-file-hint-4 code"></div>\n\t\t\t\t\t\t\t<div class="import-from-file-hint-5"></div>\n\t\t\t\t\t\t\t<div class="import-from-file-hint-6 code"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="option-divider opt-import-from-clipboard"><div></div></div>\n\t\t\t\t\t<div class="option-block opt-import-from-clipboard">\n\t\t\t\t\t\t<div class="action-button edit-button action-import-from-clipboard"></div>\n\t\t\t\t\t\t<div class="option-description">\n\t\t\t\t\t\t\t<div class="import-from-clipboard-hint-1"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="option-divider"><div></div></div>\n\t\t\t\t\t<div class="option-block">\n\t\t\t\t\t\t<div class="action-button edit-button action-create-using-wizard"></div>\n\t\t\t\t\t\t<div class="option-description">\n\t\t\t\t\t\t\t<div class="create-using-wizard-hint-1"></div>\n\t\t\t\t\t\t\t<div class="create-using-wizard-hint-2"></div>\n\t\t\t\t\t\t\t<div class="create-using-wizard-hint-3"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="option-divider"><div></div></div>\n\t\t\t\t\t<div class="option-block">\n\t\t\t\t\t\t<div class="action-button edit-button action-create-for-build-planner"></div>\n\t\t\t\t\t\t<div class="option-description">\n\t\t\t\t\t\t\t<div class="create-for-build-planner-1"></div>\n\t\t\t\t\t\t\t<div class="create-for-build-planner-input"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>'.replace(
        /[\t\n]/g,
        ""
      )
    ).appendTo(document.body);
    a.J = a.g.find(".loading-overlay");
    a.m = a.g.find(".action-button.action-create-from-scratch");
    a.D = a.g.find(".action-button.action-import-from-file");
    a.A = a.g.find(".action-button.action-import-from-clipboard");
    a.o = a.g.find(".action-button.action-create-using-wizard");
    a.j = a.g.find(".action-button.action-create-for-build-planner");
    a.L = a.g.find(".locked-overlay");
    a.g.find(".form-close-btn").click(function () {
      a.hide(!0);
    });
    a.m.click(function () {
      a.locked ||
        a.G.show({
          title: "",
          description: "",
          icon: 0,
          qc: 0,
          sc: 0,
          Qa: [],
          hc: [],
          wc: [],
        });
    });
    a.D.click(function () {
      a.locked || a.l.click();
    });
    a.A.click(function () {
      a.locked || le_Ki(a);
    });
    a.o.click(function () {
      a.locked || a.I.show();
    });
    a.j.click(function () {
      a.locked || a.B.show();
    });
    (navigator.clipboard && navigator.clipboard.readText) ||
      a.g.find(".opt-import-from-clipboard").hide();
    le_Mi(a);
  }
  show() {
    super.show();
    le_Ni(this, !1);
    this.K();
    this.g.show();
    this.locked ? this.L.show() : this.L.hide();
  }
  hide(a = !1) {
    super.hide(a);
    this.g.hide();
  }
  isActive() {
    return this.g.is(":visible");
  }
  K() {
    this.g.find(".form-header").text(le_.t("loot_filters.import_form.title"));
    this.m.text(le_.t("loot_filters.import_form.create_from_scratch"));
    this.g
      .find(".create-from-scratch-hint-1")
      .html(le_.t("loot_filters.import_form.create_from_scratch.hint"));
    this.D.text(le_.t("loot_filters.import_form.import_file"));
    this.g
      .find(".import-from-file-hint-1")
      .html(le_.t("loot_filters.import_form.import_file.hint_line_1"));
    this.g
      .find(".import-from-file-hint-2")
      .html(
        le_.t(
          "loot_filters.import_form.import_file.hint_line_2",
          {},
          "highlighted"
        )
      );
    this.g
      .find(".import-from-file-hint-3")
      .html(le_.t("loot_filters.import_form.import_file.hint_line_3"));
    this.g
      .find(".import-from-file-hint-4")
      .html(
        "<span class='code-placeholder'>[STEAM_GAME_FOLDER]</span>/steamapps/userdata/<span class='code-placeholder'>[STEAM_USER_ID]</span>/899770/ac/WinAppDataLocalLow/Eleventh Hour Games/Last Epoch/Filters/"
      );
    this.g
      .find(".import-from-file-hint-5")
      .html(le_.t("loot_filters.import_form.import_file.hint_line_4"));
    this.g
      .find(".import-from-file-hint-6")
      .html(
        "<span class='code-placeholder'>[DRIVE]</span>:/Users/<span class='code-placeholder'>[USER_NAME]</span>/AppData/LocalLow/Eleventh Hour Games/Last Epoch/Filters/"
      );
    this.A.text(le_.t("loot_filters.import_form.import_clipboard"));
    this.g
      .find(".import-from-clipboard-hint-1")
      .html(le_.t("loot_filters.import_form.import_clipboard.hint"));
    this.o.text(le_.t("loot_filters.import_form.use_filter_wizard"));
    this.g
      .find(".create-using-wizard-hint-1")
      .html(
        le_.t(
          "loot_filters.import_form.use_filter_wizard.hint_line_1",
          {},
          "highlighted"
        )
      );
    this.g
      .find(".create-using-wizard-hint-2")
      .html(le_.t("loot_filters.import_form.use_filter_wizard.hint_line_2"));
    this.g
      .find(".create-using-wizard-hint-3")
      .html(le_.t("loot_filters.import_form.use_filter_wizard.hint_line_3"));
    this.j.text(le_.t("loot_filters.import_form.create_from_planner"));
    this.g
      .find(".create-for-build-planner-1")
      .html(
        le_.t(
          "loot_filters.import_form.create_from_planner.hint",
          {},
          "highlighted"
        )
      );
    this.g
      .find(".locked-overlay .message")
      .html(
        le_
          .t("loot_filters.errors.not_logged_in")
          .replace(/<a>([^<]+)<\/a>/i, '<a href="/forum/login">$1</a>')
      );
    this.F = le_.t("loot_filters.errors.unable_to_parse_xml_file");
    this.M = le_.t("loot_filters.errors.unable_to_parse_clipboard_contents");
  }
  C() {
    this.K();
    this.G.P();
    this.I.P();
    this.B.P();
  }
}
function le_Qi() {
  const a = le_He();
  var b = le_De(a.zc, []);
  b = {
    item: $db.Dc(le_fe()),
    s: le_Ri(b.color),
    title: b.title,
    description: le_Ee(b),
  };
  const c = {
    item: le_Si(2, [36]),
    s: le_Ri(a.Tc),
    title: le_.t("loot_filters.template.groups.high_value"),
    description: le_.t("loot_filters.template.groups.high_value.hint"),
  };
  var d = a.Gb.length;
  const f = [];
  for (let m = d - 1; 0 <= m; m--) {
    d = f;
    var k = d.push;
    var n = le_De(a.Gb[m], []);
    n = {
      item: le_Si(n.$a.wa),
      s: le_Ri(n.color),
      title: n.title,
      description: le_Ee(n),
    };
    k.call(d, n);
  }
  return [b, c, ...f];
}
function le_Ti(a) {
  a.j.empty();
  a.g.find(".simulated-item").remove();
  le_Qi().forEach(function (b) {
    var c = b.s;
    var d = b.item;
    null != c && c.ma == le_M
      ? ((c = lootFilterRuleColors[c.Da]),
        (d =
          null != d.uniqueId ? c.secondary.lightColor : c.primary.lightColor))
      : (d = le_Xd(d).lightColor);
    $(`<div class="filter-template-rule" style="border-color:${d}">
			<div class="filter-template-rule-title" style="color:${d}">${b.title}</div>
			<div class="filter-template-rule-description">${b.description}</div>
		</div>`).appendTo(a.j);
    le_je(b.s, b.item).appendTo(a.g);
  });
}
function le_Ri(a) {
  return new le_N(null, le_M, a, !1, null, [], !1);
}
function le_Si(a = 0, b = null) {
  for (let d = 0; 100 > d; d++) {
    var c = le_ee();
    c = $db.Dc(c);
    if (c.compositeMods.length >= a) {
      if (null == b) break;
      for (let f = 0; f < c.compositeMods.length; f++)
        if (b.includes(c.compositeMods[f].rawAffixId)) return c;
    }
  }
  return c;
}
class le_Ui {
  constructor(a) {
    this.j = a.find(".filter-template-rules");
    this.g = a.find(".simulation-preview");
  }
}
function le_Vi(a) {
  a.ya = [];
  a.l = {};
  a.l[le_Wi] = !0;
  a.l[le_Xi] = !1;
  Object.entries(a.l).forEach(function (b) {
    const [c, d] = b;
    d && le_Yi(a, c);
  });
}
function le_Yi(a, b) {
  a.m[b].forEach(function (c) {
    a.ya.includes(c) || a.ya.push(c);
  });
}
function le_Zi(a) {
  const b = a.j.val().trim(),
    c = le__i(a);
  b && null != c ? a.i.removeClass("disabled") : a.i.addClass("disabled");
}
function le_0i(a) {
  const b = [];
  b.push(le_5(0, le_.t("loot_filters.import_planner_form.strictness.regular")));
  b.push(le_5(1, le_.t("loot_filters.import_planner_form.strictness.strict")));
  le_2(a, b, function () {});
}
function le_1i(a) {
  if (0 == a.ya.length) a.o.text(""), a.o.addClass("empty");
  else {
    let b = le_.t("loot_filters.import_planner_form.affixes_selected", {
      count: a.ya.length,
    });
    a.o.html(b);
    a.o.removeClass("empty");
  }
}
function le_2i(a, b, c) {
  const d = $(
    '<div class="checkbox-container">\n\t\t\t<div class="checkbox"></div>\n\t\t\t<div class="checkbox-label"></div>\n\t\t</div>'.replace(
      /[\t\n]/g,
      ""
    )
  ).appendTo(b);
  b = d.find(".checkbox-label");
  const f = [];
  a.m[c].forEach(function (n) {
    const m = le_A[n];
    if (m) {
      n = $db.pc(m.rarityTier);
      const p = $db.cd(m),
        r = [];
      m.affixProperties.forEach(function (z) {
        const I = $db.ad(m, z);
        z = $db.bd(z.modifierType);
        r.push(`<div>${I}<span class="affix-type">(${z})</span></div>`);
      });
      const w = $db.hd(m);
      f.push(
        `<div class="affix-entry" title="${w}"">${
          r.join("") + `<div class="affix-extra">${p} / ${n}</div>`
        }</div>`
      );
    }
  });
  const k = `<div class="extra-affixes-tooltip">${f.join("")}</div>`;
  d.click(function () {
    a.l[c] = !a.l[c];
    le_4(d, a.l[c]);
    a.l[c] ? le_Yi(a, c) : le_3i(a, c);
    le_1i(a);
  });
  tippy(d[0], {
    theme: "plain",
    arrow: !1,
    allowHTML: !0,
    delay: [100, 0],
    placement: "right",
    content: k,
  });
  a.A[c] = { title: b, Ec: d };
}
function le_4i(a) {
  const b = le__i(a),
    c = a.j.val().trim(),
    d = { af: 1 == a.L.val(), ld: !1, ya: a.ya };
  le_5i(
    a,
    !0,
    le_.t("loot_filters.import_planner_form.loading_build_data_indicator")
  );
  le_5f(
    b,
    function (f) {
      f = a.Aa.ed(b, f, c, d);
      a.callbacks.qd(f);
      a.hide();
    },
    function () {
      le_5i(a, !1);
    }
  );
}
function le_3i(a, b) {
  const c = a.m[b];
  a.ya = a.ya.filter(function (d) {
    return !c.includes(d);
  });
}
function le_5i(a, b, c) {
  b ? (a.J.find("div").text(c || ""), a.J.show()) : a.J.hide();
}
function le__i(a) {
  return (a = a.B.val().match(new RegExp("^" + a.G + "(.+)$"))) ? a[1] : null;
}
class le_Oi extends le_6 {
  constructor(a) {
    super();
    this.callbacks = a;
    this.F = `${window.location.protocol}//${window.location.host}/planner/`;
    this.G = `${window.location.protocol}//${window.location.host}/planner/(?:\\w+/)?`;
    this.Aa = new le_Tf();
    this.D = new le_fi();
    this.m = {};
    this.m[le_Wi] = le_Qe().ea;
    this.m[le_Xi] = le_Re().ea;
    le_Vi(this);
  }
  V() {
    const a = this;
    a.g = $(
      `<div id="filter-import-planner-form-overlay" class="common-overlay" style="display:none">
			<div class="common-overlay-form filter-import-planner-form">
				<div class="form-header"></div>
				<div class="form-close-btn">
					<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#808080"><path d="m6.062 15.667-1.729-1.729L8.271 10 4.333 6.062l1.729-1.729L10 8.271l3.938-3.938 1.729 1.729L11.729 10l3.938 3.938-1.729 1.729L10 11.729Z"/></svg>
				</div>
				<div class="form-content">
					<div class="loading-overlay" style="display:none"><div></div></div>
					<div class="build-planner-hint-1"></div>
					<div class="form-field" field="build-planner">
						<div class="form-field-title"></div>
						<input type="text" />
					</div>

					<div class="filter-import-planner-category-header category-settings-header">
						<div class="category-divider-line"></div>
						<div class="category-text"></div>
						<div class="category-divider-line"></div>
					</div>
					<div class="form-field" field="filter-title">
						<div class="form-field-title"></div>
						<input type="text" />
					</div>
					<div class="form-field" field="filter-strictness">
						<div class="form-field-title"></div>
						<div class="select-wrapper"></div>
					</div>
					<div class="form-field" field="filter-add-extra-affixes">
						<div class="form-field-title"></div>
						<div class="affix-select-wrapper">
							<div class="affix-select"></div>
							<div class="affix-select-predefined-list">
							</div>
							<div class="affix-select-help">
								${le_qg()}
							</div>
						</div>
					</div>

					<div class="filter-import-planner-category-header category-template-header">
						<div class="category-divider-line"></div>
						<div class="category-text"></div>
						<div class="category-divider-line"></div>
					</div>
					<div class="filter-template">
						<div class="filter-template-rules"></div>
						<div class="filter-template-simulation simulation-preview"></div>
					</div>
				</div>
				<div class="form-buttons">
					<div class="apply-btn action-cancel"></div>
					<div class="apply-btn action-save"></div>
				</div>
			</div>
		</div>`.replace(/[\t\n]/g, "")
    ).appendTo(document.body);
    a.J = a.g.find(".loading-overlay");
    var b = a.g.find(".filter-template");
    a.pb = new le_Ui(b);
    a.j = a.g.find('.form-field[field="filter-title"] input');
    a.j.on("keyup", function () {
      le_Zi(a);
    });
    a.B = a.g.find('.form-field[field="build-planner"] input');
    le_0i(a.g.find('.form-field[field="filter-strictness"] .select-wrapper'));
    a.L = a.g.find('.form-field[field="filter-strictness"] select');
    a.o = a.g.find(
      '.form-field[field="filter-add-extra-affixes"] .affix-select'
    );
    a.o.click(function () {
      a.D.ud(a.ya, {
        fb: function (c) {
          a.ya = c;
          le_1i(a);
        },
      });
    });
    b = a.g.find(
      '.form-field[field="filter-add-extra-affixes"] .affix-select-predefined-list'
    );
    a.A = {};
    le_2i(a, b, le_Wi);
    le_2i(a, b, le_Xi);
    b = a.g.find(".affix-select-help");
    a.M = tippy(b[0], {
      theme: "plain",
      arrow: !1,
      allowHTML: !0,
      delay: [100, 0],
    });
    a.g.find(".form-close-btn").click(function () {
      a.hide(!0);
    });
    a.I = a.g.find(".apply-btn.action-cancel");
    a.I.click(function () {
      a.hide(!0);
    });
    a.i = a.g.find(".apply-btn.action-save");
    a.i.click(function () {
      a.i.hasClass("disabled") || le_4i(a);
    });
  }
  show() {
    super.show();
    const a = this;
    le_Vi(a);
    a.B.val("");
    a.j.val("");
    le_1(a.L, 0, !0);
    Object.entries(a.A).forEach(function (b) {
      const [c, d] = b;
      le_4(d.Ec, a.l[c]);
    });
    le_1i(a);
    le_Ti(a.pb);
    le_5i(a, !1);
    le_Zi(a);
    a.K();
    a.g.show();
    a.B.focus();
  }
  hide(a = !1) {
    super.hide(a);
    this.g.hide();
  }
  isActive() {
    return this.g.is(":visible");
  }
  K() {
    this.g
      .find(".form-header")
      .text(le_.t("loot_filters.import_planner_form.title"));
    this.g
      .find('.form-field[field="build-planner"] .form-field-title')
      .text(le_.t("loot_filters.import_planner_form.fields.build_planner"));
    this.g
      .find('.form-field[field="filter-title"] .form-field-title')
      .text(le_.t("loot_filters.import_planner_form.fields.title"));
    this.g
      .find('.form-field[field="filter-strictness"] .form-field-title')
      .text(le_.t("loot_filters.import_planner_form.fields.strictness"));
    this.g
      .find('.form-field[field="filter-add-extra-affixes"] .form-field-title')
      .text(le_.t("loot_filters.import_planner_form.fields.extra_affixes"));
    Object.entries(this.A).forEach(function (c) {
      const [d, f] = c;
      a: {
        switch (+d) {
          case le_Wi:
            c = le_.t(
              "loot_filters.import_planner_form.affix_groups.resistances_equipment"
            );
            break a;
          case le_Xi:
            c = le_.t("loot_filters.import_planner_form.affix_groups.valuable");
            break a;
        }
        c = void 0;
      }
      f.title.text(c);
    });
    var a = le_.t(
        "loot_filters.import_planner_form.fields.extra_affixes.hint_line_1"
      ),
      b = le_.t(
        "loot_filters.import_planner_form.fields.extra_affixes.hint_line_2",
        {},
        "text-highlight"
      );
    this.M.setContent(`<div class="affix-select-help-tooltip">
				<div>${a}</div>
				<div style="margin-top:4px">${b}</div>
			</div>`);
    a = le_.t("loot_filters.import_planner_form.description_line_1");
    b = le_.t("loot_filters.import_planner_form.description_line_2");
    this.g.find(".build-planner-hint-1").html(`${a} ${b}`);
    this.g
      .find(".category-settings-header .category-text")
      .text(le_.t("loot_filters.import_planner_form.headers.filter_settings"));
    this.g
      .find(".category-template-header .category-text")
      .text(le_.t("loot_filters.import_planner_form.headers.filter_template"));
    this.B.attr("placeholder", `${this.F}XYZ`);
    this.j.attr(
      "placeholder",
      le_.t("loot_filters.import_planner_form.fields.title.placeholder")
    );
    this.o.attr("data-empty-content", le_.t("loot_filters.select_box.select"));
    this.I.text(le_.t("loot_filters.import_planner_form.buttons.cancel"));
    this.i.text(le_.t("loot_filters.import_planner_form.buttons.create"));
  }
  C() {
    this.K();
    this.D.P();
    le_Ti(this.pb);
  }
}
var le_Wi = 0,
  le_Xi = 1;
function le_6i(a) {
  a.nb = !1;
  a.ha = 0;
  a.Ob = 0;
  a.S = [];
  a.Y = [];
  a.jc = le_te;
  a.Ha = [];
  a.Ab = !1;
  a.Bb = !1;
  a.tb = [];
  a.Pb = le_we;
  a.Cb = !1;
  a.Db = !1;
  a.zb = !1;
  a.ea = [];
  Object.entries(a.o).forEach(function (d) {
    const [f, k] = d;
    a.ea[f] = { types: 1 < k.length ? [] : k, Rb: [] };
  });
  const b = [];
  b[le_7.bc] = !0;
  b[le_7.cc] = !1;
  b[le_7.Sb] = !1;
  b[le_7.Vb] = !1;
  b[le_7.Tb] = !1;
  b[le_7.Wb] = !0;
  b[le_7.Ub] = !0;
  b[le_7.dc] = !1;
  b[le_7.Xb] = !0;
  b[le_7.Yb] = !1;
  b[le_7.Zb] = !1;
  b[le_7.$b] = !1;
  b[le_7.ac] = !0;
  const c = [];
  c[le_7.bc] = !0;
  c[le_7.cc] = !1;
  c[le_7.Sb] = !1;
  c[le_7.Vb] = !1;
  c[le_7.Tb] = !1;
  c[le_7.Wb] = !0;
  c[le_7.Ub] = !0;
  c[le_7.dc] = !1;
  c[le_7.Xb] = !0;
  c[le_7.Yb] = !1;
  c[le_7.Zb] = !1;
  c[le_7.$b] = !1;
  c[le_7.ac] = !0;
  a.l = {};
  a.l[le_Y] = b;
  a.l[le_X] = c;
  a.H = {};
  a.H[le_Y] = [];
  a.H[le_X] = [];
  le_7i(a);
  le_8i(a);
}
function le_9i() {
  const a = {};
  a[le_7.bc] = { H: [], ka: [] };
  a[le_7.cc] = { H: [], ka: [] };
  a[le_7.Sb] = { H: [], ka: [] };
  a[le_7.Vb] = { H: [], ka: [] };
  a[le_7.Tb] = { H: [], ka: [] };
  a[le_7.Wb] = { H: [], ka: [] };
  a[le_7.Ub] = { H: [], ka: [] };
  a[le_7.dc] = { H: [], ka: [] };
  a[le_7.Xb] = { H: [], ka: [] };
  a[le_7.Yb] = { H: [], ka: [] };
  a[le_7.Zb] = { H: [], ka: [] };
  a[le_7.$b] = { H: [], ka: [] };
  a[le_7.ac] = { H: [], ka: [] };
  return a;
}
function le_$i(a) {
  if (!a.Mb) {
    a.Mb = !0;
    var b = {};
    b[le_7.bc] = le_Qe();
    b[le_7.cc] = le_Re();
    b[le_7.Sb] = le_Se();
    b[le_7.Vb] = le_Te();
    b[le_7.Tb] = le_Ue();
    b[le_7.Wb] = le_Ve();
    b[le_7.Ub] = le_We();
    b[le_7.dc] = le_Xe();
    b[le_7.Xb] = le_Ye();
    b[le_7.Yb] = le_Ze();
    b[le_7.Zb] = le__e();
    b[le_7.$b] = le_0e();
    b[le_7.ac] = le_1e();
    Object.entries(b).forEach(function (c) {
      const [d, f] = c;
      a.m[le_Y][d].H = f.ea;
      a.m[le_X][d].H = f.kd;
    });
  }
}
function le_7i(a) {
  const b = le_aj(a);
  Object.entries(a.l[le_Y]).forEach(function (d) {
    [d] = d;
    d = a.m[le_Y][d];
    d.ka = le_Ne(d.H, a.ha, b);
  });
  const c = $db.ab.slice();
  Object.entries(a.l[le_X]).forEach(function (d) {
    [d] = d;
    d = a.m[le_X][d];
    d.ka = le_Ne(d.H, a.ha, c);
  });
}
function le_8i(a) {
  const b = [],
    c = [];
  a.H[le_Y] = b;
  a.H[le_X] = c;
  Object.entries(a.l).forEach(function (k) {
    const [n, m] = k;
    Object.entries(m).forEach(function (p) {
      const [r, w] = p;
      w && le_bj(a, n, r);
    });
  });
  const d = a.nb
      ? le_Ae(a.ha, a.S, a.Y, {
          jc: a.jc,
          Pb: a.Pb,
          Ha: a.Ha,
          Bb: a.Bb,
          Ab: a.Ab,
          zb: a.zb,
          Cb: a.Cb,
          Db: a.Db,
        })
      : [],
    f = le_aj(a);
  le_Le(d, f).forEach(function (k) {
    b.includes(k) || b.push(k);
  });
  le_Le(d, $db.ab.slice()).forEach(function (k) {
    c.includes(k) || c.push(k);
  });
}
function le_cj(a) {
  var b = [];
  0 == a.S.length &&
    b.push(
      le_.t(
        "loot_filters.filter_wizard.errors.attack_type_not_selected",
        {},
        "text-highlight2"
      )
    );
  0 == a.Y.length &&
    b.push(
      le_.t(
        "loot_filters.filter_wizard.errors.damage_type_not_selected",
        {},
        "text-highlight2"
      )
    );
  0 == a.ea[0].types.length &&
    b.push(
      le_.t(
        "loot_filters.filter_wizard.errors.main_hand_not_selected",
        {},
        "text-highlight2"
      )
    );
  0 == a.ea[1].types.length &&
    b.push(
      le_.t(
        "loot_filters.filter_wizard.errors.off_hand_not_selected",
        {},
        "text-highlight2"
      )
    );
  a.nb = 0 == b.length;
  a.j.val().trim() ||
    b.push(
      le_.t(
        "loot_filters.filter_wizard.errors.title_is_empty",
        {},
        "text-highlight2"
      )
    );
  0 == b.length
    ? (a.i.removeClass("disabled"), a.ga.disable())
    : (a.i.addClass("disabled"),
      (b = b.map(function (c) {
        return `<div>${c}</div>`;
      })),
      a.ga.setContent(`<div class="apply-button-tooltip">${b.join("")}</div>`),
      a.ga.enable());
}
function le_dj(a, b) {
  const c = [];
  classInfoForSources.forEach(function (d, f) {
    const k = d.thirdMasteryUnlocked;
    d.characterClass.masteries.forEach(function (n, m) {
      const p = `${f}-${m}`;
      n = le_e(n);
      c.push(
        le_5(p, n, {
          Kb: 0 == m ? "opt-class" : "opt-mastery",
          disabled: !k && 3 == m,
        })
      );
    });
  });
  le_2(
    b,
    c,
    function (d) {
      const [f, k] = d.split("-");
      a.ha = +f;
      a.Ob = +k;
      a.tb = [];
      a.Ba.empty();
      le_og(a.Ba, le_ej(a));
      a.Ha = [];
      a.ja.empty();
      le_og(a.ja, le_fj(a));
      le_gj(a, 0);
      le_gj(a, 1);
      le_hj(a);
      le_ij(a);
      le_cj(a);
      le_7i(a);
      le_jj(a);
      le_8i(a);
      le_8(a, le_Y);
      le_8(a, le_X);
    },
    { rd: !0 }
  );
}
function le_kj(a, b) {
  const c = [];
  [AT.Melee, AT.Spell, AT.Bow, AT.Throwing].forEach(function (d) {
    const f = a.Ld(d);
    c.push(le_5(d, f));
  });
  le_3(
    b,
    c,
    le_.t("loot_filters.filter_wizard.fields.attack_type.placeholder"),
    function (d) {
      a.S = d.map(function (f) {
        return +f;
      });
      le_cj(a);
      le_9(a);
    },
    { Pc: 2 }
  );
}
function le_lj(a, b) {
  const c = [];
  [le_te, le_ue, le_ve].forEach(function (d) {
    a: {
      switch (d) {
        case le_te:
          var f = le_.t(
            "loot_filters.filter_wizard.dot_playstyles.direct_damage"
          );
          break a;
        case le_ue:
          f = le_.t("loot_filters.filter_wizard.dot_playstyles.dot");
          break a;
        case le_ve:
          f = le_.t("loot_filters.filter_wizard.dot_playstyles.mixed");
          break a;
      }
      f = void 0;
    }
    c.push(le_5(d, f));
  });
  le_2(b, c, function (d) {
    a.jc = +d;
    le_9(a);
  });
}
function le_mj(a, b) {
  const c = [];
  [
    AT.Fire,
    AT.Cold,
    AT.Lightning,
    AT.Physical,
    AT.Void,
    AT.Necrotic,
    AT.Poison,
  ].forEach(function (d) {
    const f = a.Nd(d);
    c.push(le_5(d, f));
  });
  le_3(
    b,
    c,
    le_.t("loot_filters.filter_wizard.fields.damage_type.placeholder"),
    function (d) {
      a.Y = d.map(function (f) {
        return +f;
      });
      le_cj(a);
      le_9(a);
    },
    { Pc: 3 }
  );
}
function le_nj(a, b) {
  const c = le_fj(a);
  le_3(b, c, le_.t("loot_filters.select_box.select"), function (d) {
    a.Ha = d.map(function (f) {
      return +f;
    });
    le_9(a);
  });
}
function le_9(a) {
  le_8i(a);
  le_8(a, le_Y);
  le_8(a, le_X);
}
function le_oj(a, b) {
  const c = le_ej(a);
  le_3(
    b,
    c,
    le_.t("loot_filters.filter_wizard.fields.skills.placeholder"),
    function (d) {
      a.tb = d;
      le_9(a);
    },
    { Pc: 5 }
  );
}
function le_pj(a, b) {
  const c = [];
  [le_we, le_xe, le_ye].forEach(function (d) {
    a: {
      switch (d) {
        case le_we:
          var f = le_.t(
            "loot_filters.filter_wizard.minion_playstyles.self_cast"
          );
          break a;
        case le_xe:
          f = le_.t("loot_filters.filter_wizard.minion_playstyles.minions");
          break a;
        case le_ye:
          f = le_.t("loot_filters.filter_wizard.minion_playstyles.mixed");
          break a;
      }
      f = void 0;
    }
    c.push(le_5(d, f));
  });
  le_2(b, c, function (d) {
    a.Pb = +d;
    le_hj(a);
    le_9(a);
  });
}
function le_$(a, b, c) {
  b = b.find(".filter-equipment-slots");
  var d = $(
    `<div class="equipment-select-wrapper" slot="${c}">
			<div class="field-custom-select equipment-type-select"></div>
			<div class="field-custom-select equipment-subtype-select"></div>
		</div>`.replace(/[\t\n]/g, "")
  ).appendTo(b);
  b = d.find(".equipment-type-select");
  d = d.find(".equipment-subtype-select");
  let f = a.o[c];
  1 == f.length
    ? b.addClass("single-select")
    : b.click(function () {
        const k = le_qj(c),
          n = a.ea[c].types,
          m = a.Fe[a.ha][c];
        m && (f = f.concat(m));
        a.ba.show(k, f, n, {
          fb: function (p) {
            a.ea[c] = { types: p, Rb: [] };
            le_rj(a, c);
            le_sj(a, c);
            le_cj(a);
            le_7i(a);
            le_jj(a);
            le_8i(a);
            le_8(a, le_Y);
            le_8(a, le_X);
          },
        });
      });
  d.click(function () {
    const k = le_Ie(a.ha);
    var n = a.ea[c];
    const m = n.types;
    n = n.Rb;
    1 == m.length &&
      a.W.ud(k, m[0], n, {
        fb: function (p) {
          a.ea[c].Rb = p;
          le_sj(a, c);
        },
      });
  });
  a.oa[c] = { type: b, bf: d };
}
function le_tj(a, b) {
  const c = Object.values(le_A)
    .filter(function (d) {
      return le_ze(le_U, d);
    })
    .map(function (d) {
      return d.affixId;
    });
  return le_Ne(c, a.ha, b);
}
function le_aj(a) {
  let b = [];
  Object.values(a.ea).forEach(function (c) {
    b = b.concat(c.types);
  });
  return b;
}
function le_8(a, b) {
  var c = a.H[b];
  a = a.R[b];
  0 == c.length
    ? (a.text(""), a.addClass("empty"))
    : ((c = le_.t("loot_filters.filter_wizard.affixes_selected", {
        count: c.length,
      })),
      a.html(c),
      a.removeClass("empty"));
}
function le_uj(a, b, c, d) {
  const f = $(
    '<div class="checkbox-container">\n\t\t\t<div class="checkbox"></div>\n\t\t\t<div class="checkbox-label"></div>\n\t\t</div>'.replace(
      /[\t\n]/g,
      ""
    )
  ).appendTo(b);
  b = f.find(".checkbox-label");
  f.click(function () {
    f.hasClass("checkbox-disabled") ||
      ((a.l[c][d] = !a.l[c][d]),
      le_4(f, a.l[c][d]),
      a.l[c][d] ? le_bj(a, c, d) : le_vj(a, c, d),
      le_8(a, c));
  });
  const k = tippy(f[0], {
    theme: "plain",
    arrow: !1,
    allowHTML: !0,
    delay: [100, 0],
    placement: "right",
  });
  let n = a.A[c];
  null == n && ((n = {}), (a.A[c] = n));
  a.A[c][d] = { title: b, Ec: f, tippy: k };
}
function le_wj(a) {
  const b = a.L;
  0 >= b.scrollTop()
    ? a.B.is(":visible") && a.B.hide()
    : a.B.is(":visible") || a.B.show();
  Math.ceil(b.scrollTop() + b.innerHeight()) >= b[0].scrollHeight
    ? a.J.is(":visible") && a.J.hide()
    : a.J.is(":visible") || a.J.show();
}
function le_bj(a, b, c) {
  const d = a.H[b];
  a.m[b][c].ka.forEach(function (f) {
    d.includes(f) || d.push(f);
  });
}
function le_vj(a, b, c) {
  const d = a.m[b][c].ka;
  a.H[b] = a.H[b].filter(function (f) {
    return !d.includes(f);
  });
}
function le_xj(a, b, c) {
  var d = a.A[b][c];
  const f = d.tippy;
  d = d.Ec;
  const k = [];
  a.m[b][c].ka.forEach(function (n) {
    const m = le_A[n];
    if (m) {
      n = $db.pc(m.rarityTier);
      const p = $db.cd(m),
        r = [];
      m.affixProperties.forEach(function (z) {
        const I = $db.ad(m, z);
        z = $db.bd(z.modifierType);
        r.push(`<div>${I}<span class="affix-type">(${z})</span></div>`);
      });
      const w = $db.hd(m);
      k.push(
        `<div class="affix-entry" title="${w}"">${
          r.join("") + `<div class="affix-extra">${p} / ${n}</div>`
        }</div>`
      );
    }
  });
  0 < k.length
    ? (f.setContent(`<div class="extra-affixes-tooltip">${k.join("")}</div>`),
      le_4(d, a.l[b][c]),
      d.removeClass("checkbox-disabled"))
    : ((a = `<div class="extra-affixes-tooltip">${le_.t(
        "loot_filters.filter_wizard.affix_group_not_available"
      )}</div>`),
      f.setContent(a),
      le_4(d, !1),
      d.addClass("checkbox-disabled"));
}
function le_gj(a, b) {
  a.ea[b] = { types: [], Rb: [] };
  le_rj(a, b);
  le_sj(a, b);
}
function le_hj(a) {
  a.Pb == le_we || 0 != a.ha
    ? (a.F.addClass("checkbox-disabled"), le_4(a.F, !1))
    : (a.F.removeClass("checkbox-disabled"), le_4(a.F, a.Cb));
}
function le_ij(a) {
  0 == a.ha || 3 == a.ha ? a.M.show() : a.M.hide();
}
function le_ej(a) {
  const b = [];
  le_oe(a.ha, a.Ob).forEach(function (c) {
    b.push(le_5(c.id, c.name));
  });
  return b;
}
function le_fj(a) {
  const b = [];
  le_re(a.ha).forEach(function (c) {
    b.push(le_5(c.id, c.name));
  });
  return b;
}
function le_qj(a) {
  switch (+a) {
    case 0:
      return le_.t("loot_filters.filter_wizard.equipment_types.main_hand");
    case 1:
      return le_.t("loot_filters.filter_wizard.equipment_types.off_hand");
    case 2:
      return le_.t("loot_filters.filter_wizard.equipment_types.helmet");
    case 3:
      return le_.t("loot_filters.filter_wizard.equipment_types.body_armor");
    case 4:
      return le_.t("loot_filters.filter_wizard.equipment_types.gloves");
    case 5:
      return le_.t("loot_filters.filter_wizard.equipment_types.belt");
    case 6:
      return le_.t("loot_filters.filter_wizard.equipment_types.boots");
    case 7:
      return le_.t("loot_filters.filter_wizard.equipment_types.relic");
    case 8:
      return le_.t("loot_filters.filter_wizard.equipment_types.ring");
    case 9:
      return le_.t("loot_filters.filter_wizard.equipment_types.amulet");
  }
}
function le_rj(a, b) {
  const c = a.oa[b].type;
  a = a.ea[b].types || [];
  0 == a.length
    ? (c.text(""), c.removeClass("disabled"), c.addClass("empty"))
    : ((a =
        1 == a.length
          ? le_d(itemDB.itemList.equippable[a[0]])
          : le_.t("loot_filters.filter_wizard.item_types_selected", {
              count: a.length,
            })),
      c.html(a),
      c.removeClass("disabled"),
      c.removeClass("empty"));
}
function le_sj(a, b) {
  const c = a.oa[b].bf;
  b = a.ea[b];
  1 != b.types.length
    ? (c.text(""), c.addClass("disabled"), c.addClass("empty"))
    : ((a = b.Rb || []),
      0 == a.length
        ? (c.text(""), c.removeClass("disabled"), c.addClass("empty"))
        : ((b = itemDB.itemList.equippable[b.types[0]]),
          (a =
            1 == a.length
              ? le_d(b.subItems[a[0]])
              : le_.t("loot_filters.filter_wizard.subtypes_selected", {
                  count: a.length,
                })),
          c.html(a),
          c.removeClass("disabled"),
          c.removeClass("empty")));
}
function le_jj(a) {
  Object.entries(a.m).forEach(function (b) {
    const [c, d] = b;
    Object.entries(d).forEach(function (f) {
      [f] = f;
      le_xj(a, c, f);
    });
  });
}
function le_yj(a) {
  switch (+a) {
    case le_7.bc:
      return le_.t("loot_filters.filter_wizard.affix_groups.resistances");
    case le_7.cc:
      return le_.t("loot_filters.filter_wizard.affix_groups.valuable");
    case le_7.Sb:
      return le_.t("loot_filters.filter_wizard.affix_groups.armor");
    case le_7.Vb:
      return le_.t("loot_filters.filter_wizard.affix_groups.dodge");
    case le_7.Tb:
      return le_.t("loot_filters.filter_wizard.affix_groups.block");
    case le_7.Wb:
      return le_.t("loot_filters.filter_wizard.affix_groups.endurance");
    case le_7.Ub:
      return le_.t("loot_filters.filter_wizard.affix_groups.crit_avoidance");
    case le_7.dc:
      return le_.t("loot_filters.filter_wizard.affix_groups.ward");
    case le_7.Xb:
      return le_.t("loot_filters.filter_wizard.affix_groups.health");
    case le_7.Yb:
      return le_.t("loot_filters.filter_wizard.affix_groups.health_regen");
    case le_7.Zb:
      return le_.t("loot_filters.filter_wizard.affix_groups.mana");
    case le_7.$b:
      return le_.t("loot_filters.filter_wizard.affix_groups.mana_regen");
    case le_7.ac:
      return le_.t("loot_filters.filter_wizard.affix_groups.movement_speed");
  }
}
class le_Pi extends le_6 {
  constructor(a) {
    super();
    this.callbacks = a;
    this.Aa = new le_Zf();
    this.D = new le_fi();
    this.W = new le_ei();
    this.ba = new le_zj();
    this.o = {};
    this.o[0] = [5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16];
    this.o[1] = [18, 19];
    this.o[2] = [0];
    this.o[3] = [1];
    this.o[4] = [4];
    this.o[5] = [2];
    this.o[6] = [3];
    this.o[7] = [22];
    this.o[8] = [21];
    this.o[9] = [20];
    this.Fe = [
      { 1: [5, 9] },
      { 1: [9] },
      { 1: [9] },
      {},
      { 0: [23], 1: [6, 9, 17] },
    ];
    this.m = {};
    this.m[le_Y] = le_9i();
    this.m[le_X] = le_9i();
    le_6i(this);
  }
  V() {
    const a = this;
    a.g = $(
      `<div id="filter-import-wizard-form-overlay" class="common-overlay" style="display:none">
			<div class="common-overlay-form filter-import-wizard-form">
				<div class="form-header"></div>
				<div class="shade-wrap-wrapper">
					<div class="shade-wrap" style="display:none"><div></div></div>
				</div>
				<div class="form-close-btn">
					<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#808080"><path d="m6.062 15.667-1.729-1.729L8.271 10 4.333 6.062l1.729-1.729L10 8.271l3.938-3.938 1.729 1.729L11.729 10l3.938 3.938-1.729 1.729L10 11.729Z"/></svg>
				</div>
				<div class="form-content">
					<div class="build-wizard-hint-1"></div>

					<div class="form-field field-required" field="filter-title">
						<div class="form-field-title"></div>
						<input type="text" />
					</div>

					<div class="filter-import-wizard-category-header category-header-general-settings">
						<div class="category-divider-line"></div>
						<div class="category-text"></div>
						<div class="category-divider-line"></div>
					</div>
					<div class="form-field field-required" field="filter-class">
						<div class="form-field-title"></div>
						<div class="select-wrapper"></div>
					</div>
					<div class="form-field field-required" field="filter-attack-type">
						<div class="form-field-title"></div>
						<div class="select-wrapper"></div>
					</div>
					<div class="form-field field-required" field="filter-dot">
						<div class="form-field-title"></div>
						<div class="select-wrapper"></div>
					</div>
					<div class="form-field field-required" field="filter-damage-type">
						<div class="form-field-title"></div>
						<div class="select-wrapper"></div>
					</div>
					<div class="form-field" field="filter-ailments">
						<div class="form-field-title"></div>
						<div class="ext-select-wrapper">
							<div class="select-wrapper"></div>
							<div class="select-wrapper-extra">
								<div class="ailments-freeze checkbox-container">
									<div class="checkbox"></div>
									<div class="checkbox-label"></div>
								</div>
								<div class="ailments-stun checkbox-container">
									<div class="checkbox"></div>
									<div class="checkbox-label"></div>
								</div>
							</div>
							<div class="field-help-icon ailment-select-help">
								${le_qg()}
							</div>
						</div>
					</div>
					<div class="form-field" field="filter-skills">
						<div class="form-field-title"></div>
						<div class="select-wrapper"></div>
					</div>
					<div class="form-field" field="filter-minions">
						<div class="form-field-title"></div>
						<div class="ext-select-wrapper">
							<div class="select-wrapper"></div>
							<div class="select-wrapper-extra">
								<div class="minions-totems checkbox-container">
									<div class="checkbox"></div>
									<div class="checkbox-label"></div>
								</div>
							</div>
							<div class="field-help-icon minion-help">
								${le_qg()}
							</div>
						</div>
					</div>
					<div class="form-field" field="filter-other">
						<div class="form-field-title"></div>
						<div class="form-checkbox-list">
							<div class="other-channelling checkbox-container">
								<div class="checkbox"></div>
								<div class="checkbox-label"></div>
							</div>
							<div class="other-transforms checkbox-container">
								<div class="checkbox"></div>
								<div class="checkbox-label"></div>
							</div>
						</div>
					</div>

					<div class="filter-import-wizard-category-header category-header-equipment-settings">
						<div class="category-divider-line"></div>
						<div class="category-text"></div>
						<div class="category-divider-line"></div>
					</div>
					<div class="form-field field-required" field="filter-equipment-main-hand">
						<div class="form-field-title"></div>
						<div class="filter-equipment-slots"></div>
					</div>
					<div class="form-field field-required" field="filter-equipment-off-hand">
						<div class="form-field-title"></div>
						<div class="filter-equipment-slots"></div>
					</div>
					<div class="form-field" field="filter-equipment-armor">
						<div class="form-field-title"></div>
						<div class="filter-equipment-slots"></div>
					</div>
					<div class="form-field" field="filter-equipment-other">
						<div class="form-field-title"></div>
						<div class="filter-equipment-slots"></div>
					</div>

					<div class="filter-import-wizard-category-header category-header-advanced-settings">
						<div class="category-divider-line"></div>
						<div class="category-text"></div>
						<div class="category-divider-line"></div>
					</div>
					<div class="form-field" field="filter-equipment-affixes">
						<div class="form-field-title"></div>
						<div class="ext-select-wrapper">
							<div class="field-custom-select"></div>
							<div class="select-wrapper-extra">
							</div>
							<div class="field-help-icon equip-affix-help">
								${le_qg()}
							</div>
						</div>
					</div>
					<div class="form-field" field="filter-idol-affixes">
						<div class="form-field-title"></div>
						<div class="ext-select-wrapper">
							<div class="field-custom-select"></div>
							<div class="select-wrapper-extra">
							</div>
							<div class="field-help-icon idol-affix-help">
								${le_qg()}
							</div>
						</div>
					</div>

					<div class="filter-import-wizard-category-header category-header-filter-template">
						<div class="category-divider-line"></div>
						<div class="category-text"></div>
						<div class="category-divider-line"></div>
					</div>
					<div class="filter-template">
						<div class="filter-template-rules"></div>
						<div class="filter-template-simulation simulation-preview"></div>
					</div>
				</div>
				<div class="form-buttons">
					<div class="shade-wrap" style="display:none"><div></div></div>
					<div class="apply-btn action-cancel"></div>
					<div class="apply-btn action-save"></div>
				</div>
			</div>
		</div>`.replace(/[\t\n]/g, "")
    ).appendTo(document.body);
    a.L = a.g.find(".form-content");
    a.B = a.g.find(".shade-wrap-wrapper .shade-wrap");
    a.J = a.g.find(".form-buttons .shade-wrap");
    var b = a.g.find(".filter-template");
    a.pb = new le_Ui(b);
    a.j = a.g.find('.form-field[field="filter-title"] input');
    a.j.on("keyup", function () {
      le_cj(a);
    });
    le_dj(a, a.g.find('.form-field[field="filter-class"] .select-wrapper'));
    a.T = a.g.find('.form-field[field="filter-class"] select');
    le_kj(
      a,
      a.g.find('.form-field[field="filter-attack-type"] .select-wrapper')
    );
    a.mc = a.g.find('.form-field[field="filter-attack-type"] select');
    le_lj(a, a.g.find('.form-field[field="filter-dot"] .select-wrapper'));
    a.xe = a.g.find('.form-field[field="filter-dot"] select');
    le_mj(
      a,
      a.g.find('.form-field[field="filter-damage-type"] .select-wrapper')
    );
    a.dd = a.g.find('.form-field[field="filter-damage-type"] select');
    le_nj(a, a.g.find('.form-field[field="filter-ailments"] .select-wrapper'));
    a.ja = a.g.find('.form-field[field="filter-ailments"] select');
    a.ca = a.g.find('.form-field[field="filter-ailments"] .ailments-freeze');
    a.ca.click(function () {
      a.Ab = !a.Ab;
      le_4(a.ca, a.Ab);
      le_9(a);
    });
    a.fa = a.g.find('.form-field[field="filter-ailments"] .ailments-stun');
    a.fa.click(function () {
      a.Bb = !a.Bb;
      le_4(a.fa, a.Bb);
      le_9(a);
    });
    b = a.g.find(".ailment-select-help");
    a.kc = tippy(b[0], {
      theme: "plain",
      arrow: !1,
      allowHTML: !0,
      delay: [100, 0],
    });
    le_oj(a, a.g.find('.form-field[field="filter-skills"] .select-wrapper'));
    a.Ba = a.g.find('.form-field[field="filter-skills"] select');
    le_pj(a, a.g.find('.form-field[field="filter-minions"] .select-wrapper'));
    a.Ie = a.g.find('.form-field[field="filter-minions"] select');
    a.F = a.g.find('.form-field[field="filter-minions"] .minions-totems');
    a.F.click(function () {
      a.F.hasClass("checkbox-disabled") ||
        ((a.Cb = !a.Cb), le_4(a.F, a.Cb), le_9(a));
    });
    b = a.g.find(".minion-help");
    a.He = tippy(b[0], {
      theme: "plain",
      arrow: !1,
      allowHTML: !0,
      delay: [100, 0],
    });
    a.M = a.g.find('.form-field[field="filter-other"] .other-transforms');
    a.M.click(function () {
      a.Db = !a.Db;
      le_4(a.M, a.Db);
      le_9(a);
    });
    a.X = a.g.find('.form-field[field="filter-other"] .other-channelling');
    a.X.click(function () {
      a.zb = !a.zb;
      le_4(a.X, a.zb);
      le_9(a);
    });
    a.oa = {};
    a.Za = a.g.find('.form-field[field="filter-equipment-main-hand"]');
    a.mb = a.g.find('.form-field[field="filter-equipment-off-hand"]');
    a.G = a.g.find('.form-field[field="filter-equipment-armor"]');
    a.N = a.g.find('.form-field[field="filter-equipment-other"]');
    le_$(a, a.Za, 0);
    le_$(a, a.mb, 1);
    le_$(a, a.G, 2);
    le_$(a, a.G, 3);
    le_$(a, a.G, 4);
    le_$(a, a.G, 5);
    le_$(a, a.G, 6);
    le_$(a, a.N, 7);
    le_$(a, a.N, 8);
    le_$(a, a.N, 9);
    b = a.g.find(
      '.form-field[field="filter-equipment-affixes"] .field-custom-select'
    );
    b.click(function () {
      const k = le_tj(a, le_aj(a));
      a.D.ae(k, a.H[le_Y], {
        fb: function (n) {
          a.H[le_Y] = n;
          le_8(a, le_Y);
        },
      });
    });
    const c = a.g.find(
      '.form-field[field="filter-idol-affixes"] .field-custom-select'
    );
    c.click(function () {
      const k = le_tj(a, $db.ab.slice());
      a.D.ae(k, a.H[le_X], {
        fb: function (n) {
          a.H[le_X] = n;
          le_8(a, le_X);
        },
      });
    });
    a.R = {};
    a.R[le_Y] = b;
    a.R[le_X] = c;
    b = a.g.find(".equip-affix-help");
    a.ye = tippy(b[0], {
      theme: "plain",
      arrow: !1,
      allowHTML: !0,
      delay: [100, 0],
    });
    b = a.g.find(".idol-affix-help");
    a.Ge = tippy(b[0], {
      theme: "plain",
      arrow: !1,
      allowHTML: !0,
      delay: [100, 0],
    });
    a.A = {};
    const d = a.g.find(
        '.form-field[field="filter-equipment-affixes"] .select-wrapper-extra'
      ),
      f = a.g.find(
        '.form-field[field="filter-idol-affixes"] .select-wrapper-extra'
      );
    Object.values(le_7)
      .sort(function (k, n) {
        return k - n;
      })
      .forEach(function (k) {
        le_uj(a, d, le_Y, k);
        le_uj(a, f, le_X, k);
      });
    a.g.find(".form-close-btn").click(function () {
      a.hide(!0);
    });
    a.I = a.g.find(".apply-btn.action-cancel");
    a.I.click(function () {
      a.hide(!0);
    });
    a.i = a.g.find(".apply-btn.action-save");
    a.i.click(function () {
      if (!a.i.hasClass("disabled")) {
        var k = {
          title: a.j.val().trim(),
          ha: a.ha,
          Ob: a.Ob,
          tb: a.tb,
          ea: a.ea,
          H: a.H,
        };
        k = a.Aa.ed(k);
        a.callbacks.qd(k);
        a.hide();
      }
    });
    a.ga = tippy(a.i[0], {
      theme: "plain",
      arrow: !1,
      allowHTML: !0,
      delay: [100, 0],
    });
    a.L.on("scroll", function () {
      le_wj(a);
    });
  }
  show() {
    super.show();
    const a = this;
    le_$i(a);
    le_6i(a);
    a.j.val("");
    le_1(a.T, `${a.ha}-${a.Ob}`, !0);
    le_1(a.mc, a.S, !0);
    le_1(a.dd, a.Y, !0);
    le_1(a.xe, a.jc, !0);
    le_1(a.ja, a.Ha, !0);
    le_4(a.ca, a.Ab);
    le_4(a.fa, a.Bb);
    le_1(a.Ba, a.tb, !0);
    le_1(a.Ie, a.Pb, !0);
    le_hj(a);
    le_4(a.M, a.Db);
    le_ij(a);
    le_4(a.X, a.zb);
    Object.keys(a.o).forEach(function (b) {
      le_rj(a, b);
      le_sj(a, b);
    });
    Object.entries(a.A).forEach(function (b) {
      const [c, d] = b;
      Object.entries(d).forEach(function (f) {
        const [k, n] = f;
        le_4(n.Ec, a.l[c][k]);
      });
    });
    le_jj(a);
    le_8(a, le_Y);
    le_8(a, le_X);
    le_Ti(a.pb);
    le_cj(a);
    a.K();
    a.g.show();
    a.j.focus();
    a.L.scrollTop(0);
    le_wj(a);
  }
  hide(a = !1) {
    super.hide(a);
    this.g.hide();
  }
  isActive() {
    return this.g.is(":visible");
  }
  Ld(a) {
    switch (a) {
      case AT.Melee:
        return le_.t("planner.attack_types.melee");
      case AT.Spell:
        return le_.t("planner.attack_types.spell");
      case AT.Bow:
        return le_.t("planner.attack_types.bow");
      case AT.Throwing:
        return le_.t("planner.attack_types.throwing");
      case AT.DoT:
        return le_.t("planner.attack_types.damage_over_time");
      default:
        return "";
    }
  }
  Nd(a) {
    switch (a) {
      case AT.Physical:
        return le_.t("planner.damage_types.physical");
      case AT.Fire:
        return le_.t("planner.damage_types.fire");
      case AT.Cold:
        return le_.t("planner.damage_types.cold");
      case AT.Lightning:
        return le_.t("planner.damage_types.lightning");
      case AT.Necrotic:
        return le_.t("planner.damage_types.necrotic");
      case AT.Void:
        return le_.t("planner.damage_types.void");
      case AT.Poison:
        return le_.t("planner.damage_types.poison");
      default:
        return "";
    }
  }
  K() {
    this.g.find(".form-header").text(le_.t("loot_filters.filter_wizard.title"));
    this.g
      .find('.form-field[field="filter-title"] .form-field-title')
      .text(le_.t("loot_filters.filter_wizard.fields.title"));
    this.g
      .find('.form-field[field="filter-class"] .form-field-title')
      .text(le_.t("loot_filters.filter_wizard.fields.class"));
    this.g
      .find('.form-field[field="filter-attack-type"] .form-field-title')
      .text(le_.t("loot_filters.filter_wizard.fields.attack_type"));
    this.g
      .find('.form-field[field="filter-dot"] .form-field-title')
      .text(
        le_.t("loot_filters.filter_wizard.fields.damage_over_time_playstyle")
      );
    this.g
      .find('.form-field[field="filter-damage-type"] .form-field-title')
      .text(le_.t("loot_filters.filter_wizard.fields.damage_type"));
    this.g
      .find('.form-field[field="filter-ailments"] .form-field-title')
      .text(le_.t("loot_filters.filter_wizard.fields.ailments"));
    this.ca
      .find(".checkbox-label")
      .text(le_.t("loot_filters.filter_wizard.fields.ailments.freeze"));
    this.fa
      .find(".checkbox-label")
      .text(le_.t("loot_filters.filter_wizard.fields.ailments.stun"));
    this.g
      .find('.form-field[field="filter-skills"] .form-field-title')
      .text(le_.t("loot_filters.filter_wizard.fields.skills"));
    this.g
      .find('.form-field[field="filter-minions"] .form-field-title')
      .text(le_.t("loot_filters.filter_wizard.fields.minion_playstyle"));
    this.F.find(".checkbox-label").text(
      le_.t("loot_filters.filter_wizard.fields.minion_playstyle.use_totems")
    );
    this.g
      .find('.form-field[field="filter-other"] .form-field-title')
      .text(le_.t("loot_filters.filter_wizard.fields.other"));
    this.M.find(".checkbox-label").text(
      le_.t("loot_filters.filter_wizard.fields.other.transform")
    );
    this.X.find(".checkbox-label").text(
      le_.t("loot_filters.filter_wizard.fields.other.channelled")
    );
    this.Za.find(".form-field-title").text(le_qj(0));
    this.mb.find(".form-field-title").text(le_qj(1));
    this.G.find(".form-field-title").text(
      le_.t("loot_filters.filter_wizard.equipment_types.armor")
    );
    this.N.find(".form-field-title").text(
      le_.t("loot_filters.filter_wizard.equipment_types.other")
    );
    this.G.find(".equipment-select-wrapper").each(function () {
      const k = $(this);
      var n = $(k).attr("slot");
      n = le_qj(n);
      $(k).find(".equipment-type-select").text(n);
    });
    this.N.find(".equipment-select-wrapper").each(function () {
      const k = $(this);
      var n = k.attr("slot");
      n = le_qj(n);
      k.find(".equipment-type-select").text(n);
    });
    this.g
      .find('.form-field[field="filter-equipment-affixes"] .form-field-title')
      .text(le_.t("loot_filters.filter_wizard.affix_categories.equipment"));
    this.g
      .find('.form-field[field="filter-idol-affixes"] .form-field-title')
      .text(le_.t("loot_filters.filter_wizard.affix_categories.idols"));
    Object.entries(this.A).forEach(function (k) {
      [, k] = k;
      Object.entries(k).forEach(function (n) {
        const [m, p] = n;
        n = le_yj(m);
        p.title.text(n);
      });
    });
    var a = le_.t("loot_filters.filter_wizard.fields.ailments.hint_line_1"),
      b = le_.t(
        "loot_filters.filter_wizard.fields.ailments.hint_line_2",
        {},
        "text-highlight"
      );
    this.kc.setContent(`<div class="ailment-select-help-tooltip">
				<div>${a}</div>
				<div style="margin-top:4px">${b}</div>
			</div>`);
    a = le_.t("loot_filters.filter_wizard.fields.minion_playstyle.hint_line_1");
    b = le_.t(
      "loot_filters.filter_wizard.fields.minion_playstyle.hint_line_2",
      {},
      "text-highlight"
    );
    var c = le_
        .t(
          "loot_filters.filter_wizard.fields.minion_playstyle.hint_line_3",
          {},
          "text-highlight2"
        )
        .replace(/<b2>/g, "<span class='text-highlight'>")
        .replace(/<\/b2>/g, "</span>"),
      d = le_
        .t(
          "loot_filters.filter_wizard.fields.minion_playstyle.hint_line_4",
          {},
          "text-highlight2"
        )
        .replace(/<b2>/g, "<span class='text-highlight'>")
        .replace(/<\/b2>/g, "</span>");
    const f = le_
      .t(
        "loot_filters.filter_wizard.fields.minion_playstyle.hint_line_5",
        {},
        "text-highlight2"
      )
      .replace(/<b2>/g, "<span class='text-highlight'>")
      .replace(/<\/b2>/g, "</span>");
    this.He.setContent(`<div class="minion-help-tooltip">
				<div>${a}</div>
				<div style="margin-top:4px">${b}</div>
				<div style="margin-top:4px">${c}</div>
				<div style="margin-top:4px">${d}</div>
				<div style="margin-top:4px">${f}</div>
			</div>`);
    a = le_.t(
      "loot_filters.filter_wizard.affixes_help_line_1",
      {},
      "text-highlight"
    );
    b = le_.t("loot_filters.filter_wizard.affixes_help_line_2");
    c = le_.t("loot_filters.filter_wizard.affixes_help_line_3");
    d = le_.t(
      "loot_filters.filter_wizard.affixes_help_line_4",
      {},
      "text-highlight"
    );
    a = `<div class="affix-select-help-tooltip">
				<div>${a}</div>
				<div style="margin-top:4px;">${b}</div>
				<div style="margin-top:4px;">${c}</div>
				<div style="margin-top:4px;color:#f44;">${d}</div>
			</div>`;
    this.ye.setContent(a);
    this.Ge.setContent(a);
    a = le_.t("loot_filters.filter_wizard.description_line_1");
    b = le_.t(
      "loot_filters.filter_wizard.description_line_2",
      {},
      "text-highlight"
    );
    this.g.find(".build-wizard-hint-1").html(`${a} ${b}`);
    this.g
      .find(".category-header-general-settings .category-text")
      .text(le_.t("loot_filters.filter_wizard.headers.general_settings"));
    this.g
      .find(".category-header-equipment-settings .category-text")
      .text(le_.t("loot_filters.filter_wizard.headers.equipment_settings"));
    this.g
      .find(".category-header-filter-template .category-text")
      .text(le_.t("loot_filters.filter_wizard.headers.filter_template"));
    this.g
      .find(".category-header-advanced-settings .category-text")
      .text(le_.t("loot_filters.filter_wizard.headers.advanced_settings"));
    this.j.attr(
      "placeholder",
      le_.t("loot_filters.filter_wizard.fields.title.placeholder")
    );
    a = le_.t("loot_filters.select_box.select");
    b = le_.t("loot_filters.filter_wizard.subtypes_not_selected");
    c = this.g.find(".equipment-type-select");
    d = this.g.find(".equipment-subtype-select");
    c.attr("data-empty-content", a);
    d.attr("data-empty-content", b);
    d.attr("data-not-allowed-content", b);
    this.R[le_Y].attr("data-empty-content", a);
    this.R[le_X].attr("data-empty-content", a);
    this.I.text(le_.t("loot_filters.filter_wizard.buttons.cancel"));
    this.i.text(le_.t("loot_filters.filter_wizard.buttons.create"));
  }
  C() {
    this.K();
    this.D.P();
    this.W.P();
    this.ba.P();
    le_Ti(this.pb);
  }
}
var le_Y = 0,
  le_X = 1;
const le_7 = {
  bc: 0,
  Sb: 1,
  Vb: 2,
  Tb: 3,
  Wb: 4,
  Ub: 5,
  Xb: 6,
  Yb: 7,
  dc: 8,
  Zb: 9,
  $b: 10,
  ac: 11,
  cc: 12,
};
function le_Aj(a) {
  a.ja.val("");
  a.fa.hide();
}
function le_Bj(a) {
  const b = a.L;
  0 >= b.scrollTop()
    ? a.B.is(":visible") && a.B.hide()
    : a.B.is(":visible") || a.B.show();
  Math.ceil(b.scrollTop() + b.innerHeight()) >= b[0].scrollHeight
    ? a.J.is(":visible") && a.J.hide()
    : a.J.is(":visible") || a.J.show();
}
function le_Cj() {
  return '<div class="filter-restrictions-warning-icon"><svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg></div>';
}
function le_Dj(a, b, c, d, f) {
  let k = "";
  f && f.fc && (k = le_Cj());
  return `<div class="category-block">
			<div class="category-header" entry-ids="${a}" valid-entry-ids="${b}">
				<div class="checkbox checkbox-clickable"></div>
				<div class="checkbox-label expand-clickable">${c}</div>
				${k}
				<div class="entry-counter expand-clickable"></div>
				<div class="expand-collapse-button expand-clickable"><div></div></div>
			</div>
			<div class="category-contents">${d}</div>
		</div>`;
}
function le_Ej(a, b, c, d) {
  let f = "";
  d && d.fc && (f = le_Cj());
  let k = "category-entry";
  d && d.$c && (k = `${k} ${d.$c}`);
  let n = "";
  d && d.fe && (n = ` title="${d.fe}"`);
  return `<div class="${k}" entry-id="${a}" data-search="${b}"${n}>
			<div class="checkbox"></div>
			<div class="checkbox-label">${c}</div>
			${f}
		</div>`;
}
function le_Fj() {
  return '<div class="no-matches-block">No matches</div>';
}
function le_Gj(a, b, c) {
  const d = a.o.filter(function (k) {
      return -1 !== c.indexOf(k);
    }),
    f = b.siblings(".category-contents").find(".category-entry");
  0 == d.length || d.length < c.length
    ? (c.forEach(function (k) {
        -1 == a.o.indexOf(k) && a.o.push(k);
      }),
      f.each(function () {
        const k = $(this);
        le_4(k, !0);
      }),
      le_4(b, !0))
    : ((a.o = a.o.filter(function (k) {
        return -1 == c.indexOf(k);
      })),
      f.each(function () {
        const k = $(this);
        le_4(k, !1);
      }),
      le_4(b, !1));
  le_Hj(a, b);
  a.T();
}
function le_Ij(a, b, c) {
  let d;
  -1 == a.o.indexOf(c)
    ? (a.o.push(c), (d = !0))
    : ((a.o = a.o.filter(function (f) {
        return c !== f;
      })),
      (d = !1));
  le_4(b, d);
  b = b.closest(".category-block").find(".category-header");
  le_Hj(a, b);
  a.T();
}
function le_Jj(a) {
  a.j.find(".category-header .expand-clickable").click(function () {
    $(this).closest(".category-block").toggleClass("expanded");
    le_Bj(a);
  });
  a.j.find(".category-header .checkbox-clickable").click(function () {
    if (!a.l) {
      const b = $(this).closest(".category-header");
      if (!a.j.hasClass("with-search")) {
        const c = b
          .attr("entry-ids")
          .split(",")
          .map(function (d) {
            return +d;
          });
        le_Gj(a, b, c);
      }
    }
  });
  a.j.find(".category-entry").click(function (b) {
    if (!a.l && !$(b.target).is("a, a *")) {
      b = $(this);
      const c = +b.attr("entry-id");
      le_Ij(a, b, c);
    }
  });
}
function le_Hj(a, b) {
  const c = b
      .attr("entry-ids")
      .split(",")
      .map(function (k) {
        return +k;
      }),
    d = b
      .attr("valid-entry-ids")
      .split(",")
      .map(function (k) {
        return +k;
      });
  a = a.o.filter(function (k) {
    return -1 !== c.indexOf(k);
  });
  var f = a.every(function (k) {
    return d.includes(k);
  });
  b.attr("valid-entry", f);
  0 == a.length
    ? le_4(b, !1)
    : 0 < a.length && c.length == a.length
    ? le_4(b, !0)
    : le_pg(b);
  a = a.length;
  f = c.length;
  b.find(".entry-counter").text(`${a}/${f}`);
}
class le_Kj extends le_6 {
  constructor(a, b) {
    super();
    this.mc = a;
    this.kc = b;
    this.s = null;
    this.o = [];
    this.callbacks = null;
    this.R = 0;
    this.l = !1;
  }
  V() {
    const a = this;
    a.g = $(
      `<div id="${a.mc}" class="common-overlay" style="display:none">
			<div class="common-overlay-form ${a.kc} filter-group-selector-form">
				<div class="form-header"></div>
				<div class="form-close-btn">
					<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#808080"><path d="m6.062 15.667-1.729-1.729L8.271 10 4.333 6.062l1.729-1.729L10 8.271l3.938-3.938 1.729 1.729L11.729 10l3.938 3.938-1.729 1.729L10 11.729Z"/></svg>
				</div>
				<div class="form-controls">
					<div class="shade-wrap" style="display:none"><div></div></div>
					<div class="form-search-block">
						<div class="filter-search">
							<input type="text" class="input search entry-search" />
							<span class="search-icon">
								<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="16" height="16" viewBox="0 0 24 24" style="fill:#808080;!important"><path d="M 9 2 C 5.1458514 2 2 5.1458514 2 9 C 2 12.854149 5.1458514 16 9 16 C 10.747998 16 12.345009 15.348024 13.574219 14.28125 L 14 14.707031 L 14 16 L 20 22 L 22 20 L 16 14 L 14.707031 14 L 14.28125 13.574219 C 15.348024 12.345009 16 10.747998 16 9 C 16 5.1458514 12.854149 2 9 2 z M 9 4 C 11.773268 4 14 6.2267316 14 9 C 14 11.773268 11.773268 14 9 14 C 6.2267316 14 4 11.773268 4 9 C 4 6.2267316 6.2267316 4 9 4 z"></path></svg>
							</span>
							<span class="search-clear" style="display: none;">
								<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="16" height="16" viewBox="0 0 24 24" style="fill:#808080;!important"><path d="M12,2C6.47,2,2,6.47,2,12s4.47,10,10,10s10-4.47,10-10S17.53,2,12,2z M17,15.59L15.59,17L12,13.41L8.41,17L7,15.59 L10.59,12L7,8.41L8.41,7L12,10.59L15.59,7L17,8.41L13.41,12L17,15.59z"></path></svg>
							</span>
						</div>
					</div>
				</div>
				<div class="form-content">
					<div class="form-entry-list"></div>
				</div>
				<div class="form-buttons">
					<div class="shade-wrap" style="display:none"><div></div></div>
					<div class="apply-btn action-cancel"></div>
					<div class="apply-btn action-save"></div>
				</div>
			</div>
		</div>`.replace(/[\t\n]/g, "")
    ).appendTo(document.body);
    a.form = a.g.find(".filter-group-selector-form");
    a.B = a.g.find(".form-controls .shade-wrap");
    a.J = a.g.find(".form-buttons .shade-wrap");
    a.Aa = a.g.find(".form-controls");
    a.L = a.g.find(".form-content");
    a.ja = a.g.find(".filter-search input");
    a.fa = a.g.find(".filter-search .search-clear");
    a.j = a.g.find(".form-entry-list");
    a.I = a.g.find(".apply-btn.action-cancel");
    a.i = a.g.find(".apply-btn.action-save");
    a.g.find(".form-close-btn").click(function () {
      a.hide(!0);
    });
    a.I.click(function () {
      a.hide(!0);
    });
    a.i.click(function () {
      a.callbacks && a.callbacks.fb(a.o);
      a.hide();
    });
    a.ja.keyup(
      le_xg(function () {
        const b = a.ja.val().trim();
        "" == b ? a.fa.hide() : a.fa.show();
        a.X(b);
      }, 50)
    );
    a.fa.click(function () {
      le_Aj(a);
      a.X("");
    });
    a.L.on("scroll", function () {
      le_Bj(a);
    });
    a.ca();
  }
  ba(a, b) {
    return `<div class="group-block">
			<div class="group-block-header">
				<div class="group-block-divider-left"></div>
				<div class="group-block-header-title">${a}</div>
				<div class="group-block-divider-right"></div>
			</div>
			<div class="group-block-contents">${b}</div>
		</div>`;
  }
  X(a) {
    a = a.toLowerCase().replace(/\s+/g, " ").trim();
    const b = new RegExp(le_Kg(a), "ig");
    a ? this.j.addClass("with-search") : this.j.removeClass("with-search");
    let c = !1;
    this.j.find(".group-block").each(function () {
      const f = $(this);
      let k = !1;
      f.find(".category-block").each(function () {
        const n = $(this);
        let m = !1;
        n.find(".category-entry").each(function () {
          const p = $(this),
            r = p.attr("data-search");
          null != r &&
            (r.match(b)
              ? ((m = !0), p.removeClass("hidden-in-search"))
              : p.addClass("hidden-in-search"));
        });
        m
          ? ((k = !0), n.removeClass("hidden-in-search"))
          : n.addClass("hidden-in-search");
        a ? n.addClass("expanded") : n.removeClass("expanded");
      });
      k
        ? ((c = !0), f.removeClass("hidden-in-search"))
        : f.addClass("hidden-in-search");
    });
    const d = this.j.find(".no-matches-block");
    c ? d.hide() : d.show();
    this.L.scrollTop(0);
    le_Bj(this);
  }
  show(a, b, c, d) {
    super.show();
    this.s = a;
    this.o = b.slice();
    this.callbacks = c;
    this.l = d;
    this.F();
    this.l ? this.form.addClass("readonly") : this.form.removeClass("readonly");
    this.K();
    this.g.show();
    this.L.scrollTop(0);
    le_Bj(this);
  }
  F() {
    const a = this;
    a.Y();
    le_Aj(a);
    a.j.removeClass("with-search");
    a.j.find(".category-block").removeClass("expanded");
    a.j.find(".category-header").each(function () {
      const b = $(this);
      le_Hj(a, b);
    });
    a.j.find(".category-entry").each(function () {
      const b = $(this),
        c = +b.attr("entry-id");
      le_4(b, -1 != a.o.indexOf(c));
    });
    a.T();
    le_Bj(a);
  }
  hide(a = !1) {
    super.hide(a);
    this.g.hide();
  }
  isActive() {
    return this.g.is(":visible");
  }
  K() {
    this.ja.attr("placeholder", le_.t("common.search.input_placeholder"));
    this.I.text(le_.t("loot_filters.selector_form.buttons.cancel"));
    this.i.text(le_.t("loot_filters.selector_form.buttons.save"));
  }
  ca() {
    this.M();
    le_Jj(this);
  }
  Y() {}
  M() {
    throw Error("not implemented");
  }
  T() {
    throw Error("not implemented");
  }
  C() {
    this.K();
  }
}
class le_di extends le_Kj {
  constructor() {
    super("filter-item-type-form-overlay", "filter-item-type-form");
  }
  M() {
    const a = this;
    let b = 0;
    const c = [];
    itemDB.itemList.lootFilterVisualCategories.forEach(function (d) {
      const f = [];
      d.categories.forEach(function (k) {
        const n = [];
        k.entries.forEach(function (p) {
          const r = le_d(itemDB.itemList.equippable[p]);
          n.push(le_Ej(p, r, r));
        });
        b += k.entries.length;
        const m = le_Ha(k);
        k = k.entries.join(",");
        f.push(le_Dj(k, k, m, n.join("")));
      });
      d = le_Ha(d);
      c.push(a.ba(d, f.join("")));
    });
    a.R = b;
    c.push(le_Fj());
    a.j.html(c.join(""));
  }
  T() {
    const a = le_.t("loot_filters.item_type_form.title");
    this.g.find(".form-header").text(`${a} (${this.o.length}/${this.R})`);
  }
  C() {
    super.C();
  }
}
function le_Lj(a) {
  switch (a) {
    case le_B.Primalist:
      return le_.t("loot_filters.subtype_form.categories.class_specific", {
        className: le_Sa(0),
      });
    case le_B.Mage:
      return le_.t("loot_filters.subtype_form.categories.class_specific", {
        className: le_Sa(1),
      });
    case le_B.Sentinel:
      return le_.t("loot_filters.subtype_form.categories.class_specific", {
        className: le_Sa(2),
      });
    case le_B.Acolyte:
      return le_.t("loot_filters.subtype_form.categories.class_specific", {
        className: le_Sa(3),
      });
    case le_B.Rogue:
      return le_.t("loot_filters.subtype_form.categories.class_specific", {
        className: le_Sa(4),
      });
    case le_B.None:
      return le_.t("loot_filters.subtype_form.categories.non_class_specific");
  }
}
function le_Mj(a) {
  a.m = $(`<div class="form-options">
				<div class="respect-conditions-block">
					<div class="checkbox"></div>
					<div class="checkbox-label"></div>
					${le_Cj()}
				</div>
				<div class="filler"></div>
				<div class="entry-orderby-block">
					<div class="entry-orderby-select">
						<div class="select-wrapper"></div>
					</div>
				</div>
			</div>`);
  a.W = a.m.find(".respect-conditions-block");
  a.W.click(function () {
    const b = $(this);
    a.A = !a.A;
    le_4(b, a.A);
    le_bd("subtypes_restrict", a.A);
    a.F();
  });
  a.Ba = a.m.find(".filter-restrictions-warning-icon");
  a.m.appendTo(a.Aa);
  le_Nj(a, a.m.find(".entry-orderby-block .select-wrapper"));
  le_4(a.m.find(".respect-conditions-block"), a.A);
  le_1(a.m.find(".entry-orderby-block select"), a.D, !0);
  a.oa = tippy(a.m.find(".respect-conditions-block")[0], {
    content: "",
    allowHTML: !0,
    arrow: !1,
    placement: "bottom",
  });
  le_Oj(a);
}
function le_Nj(a, b) {
  const c = [];
  a.Za.forEach(function (d) {
    var f = c.push;
    a: {
      switch (d) {
        case 0:
          var k = le_.t("loot_filters.subtype_form.order_by.level");
          break a;
        case 1:
          k = le_.t("loot_filters.subtype_form.order_by.title");
          break a;
      }
      k = void 0;
    }
    f.call(c, le_5(d, k));
  });
  le_2(b, c, function (d) {
    a.D = d;
    le_bd("subtypes_orderby", a.D);
    a.F();
  });
}
function le_Oj(a) {
  a.m
    .find(".checkbox-label")
    .text(le_.t("loot_filters.subtype_form.checkbox.apply_restrictions"));
  const b = le_.t(
      "loot_filters.subtype_form.checkbox.apply_restrictions.hint_line_1"
    ),
    c = le_.t(
      "loot_filters.subtype_form.checkbox.apply_restrictions.hint_line_2",
      {},
      "highlight"
    ),
    d = le_.t(
      "loot_filters.subtype_form.checkbox.apply_restrictions.hint_line_3"
    ),
    f = le_.t(
      "loot_filters.subtype_form.checkbox.apply_restrictions.hint_line_4",
      { iconImage: le_Cj() }
    );
  a.oa.setContent(`<div class="tippy-restrictions-tooltip"> 
				<div class="option-text" style="padding:0px 0px 2px 0px">${b}</div>
				<div>${c}</div>
				<div class="option-text" style="padding:10px 0px 2px 0px">${d}</div>
				<div>${f}</div>
			</div>`);
}
function le_Pj(a) {
  const b = itemDB.itemList.equippable[a.N],
    c = le_Md(a.s),
    d = le_Nd(a.s),
    f = [],
    k = {},
    n = [];
  Object.entries(b.subItems).forEach(function (m) {
    [, m] = m;
    if (null != a.G) {
      var p = m.classRequirement;
      p = p == le_B.None || p == a.G;
    } else p = (!c || c.ta(m)) && (!d || d.ta(m));
    if (!a.A || p) {
      var r = 34 != m.baseTypeId && !$db.Sd(m) && m.cannotDrop;
      if ($db.Ee(m)) f.push(m);
      else if (!r) {
        r = m.classRequirement;
        let w = k[r];
        null == w && ((w = []), (k[r] = w));
        w.push(m);
      }
      p && n.push(m.subTypeId);
    }
  });
  return [f, k, n];
}
function le_Qj(a, b) {
  var c = le_d(a);
  const d = $db.getLevelRequirement(a),
    f = $db.te(a).map(function (k) {
      return '<div class="entry-stats">' + k + "</div>";
    });
  c = `<div>${c}<span class="entry-ilvl">${`(ilvl ${d})`}</span></div>${f.join(
    ""
  )}`;
  b &&
    (a = $db.ue(a)) &&
    ((b = le_.t("loot_filters.subtype_form.item.extra_info.uniques")),
    (c += `<div class="unique-list">${b} ${a}</div>`));
  return c;
}
class le_ei extends le_Kj {
  constructor() {
    super("filter-item-subtype-form-overlay", "filter-item-subtype-form");
    this.N = null;
    this.A = le_ed.g.load("subtypes_restrict", !0);
    this.D = le_ed.g.load("subtypes_orderby");
    null == this.D && (this.D = 0);
    this.ga = [
      le_B.Primalist,
      le_B.Mage,
      le_B.Sentinel,
      le_B.Acolyte,
      le_B.Rogue,
      le_B.None,
    ];
    this.Za = [0, 1];
  }
  V() {
    super.V();
    le_Mj(this);
  }
  ca() {}
  Y() {
    this.M();
    le_Jj(this);
  }
  show(a, b, c, d, f) {
    this.N = b;
    this.G = null;
    super.show(a, c, d, f);
    this.m.show();
  }
  ud(a, b, c, d) {
    const f = new le_N(null, le_K, 0, !1, null, [], !1);
    this.N = b;
    this.A = !0;
    this.G = a;
    this.D = 0;
    super.show(f, c, d, !1);
    this.m.hide();
  }
  X(a) {
    super.X(a);
    null != this.G &&
      (this.j.find(".category-block").addClass("expanded"),
      this.L.scrollTop(0));
  }
  F() {
    super.F();
    null != this.G && this.j.find(".category-block").addClass("expanded");
  }
  M() {
    const a = this,
      [b, c, d] = le_Pj(a),
      f = [];
    a.ga.forEach(function (m) {
      const p = c[m];
      p &&
        (p.sort(a.S.bind(a)),
        (m = le_Lj(m)),
        f.push({ name: m, categories: [{ name: m, items: p }] }));
    });
    if (null == a.G && 0 < b.length) {
      const m = le_.t("loot_filters.subtype_form.categories.uniques_only");
      b.sort(a.S.bind(a));
      f.push({
        name: m,
        categories: [{ name: m, items: b, isUniqueBase: !0 }],
      });
    }
    let k = 0;
    const n = [];
    f.forEach(function (m) {
      const p = [];
      m.categories.forEach(function (r) {
        const w = [],
          z = [];
        r.items.forEach(function (G) {
          const H = G.subTypeId;
          G = le_Qj(G, r.isUniqueBase);
          const x = G.replace(/(<([^>]+)>)/gi, " ").replace(/\s+/g, " ");
          w.push(le_Ej(H, x, G, { fc: !0, $c: "with-extras" }));
          z.push(H);
        });
        k += r.items.length;
        const I = r.name,
          N = w.join(""),
          C = z
            .filter(function (G) {
              return d.includes(G);
            })
            .join(",");
        p.push(le_Dj(z, C, I, N, { fc: !0 }));
      });
      a.R = k;
      n.push(a.ba(m.name, p.join("")));
    });
    n.push(le_Fj());
    a.j.html(n.join(""));
    a.j.find(".category-entry").each(function () {
      const m = $(this),
        p = +m.attr("entry-id");
      m.attr("valid-entry", -1 != d.indexOf(p));
    });
  }
  S(a, b) {
    if (0 == this.D) {
      const c = $db.getLevelRequirement(a),
        d = $db.getLevelRequirement(b);
      if (c != d) return c - d;
    }
    a = le_d(a).toLowerCase();
    b = le_d(b).toLowerCase();
    return a.localeCompare(b);
  }
  T() {
    var a = le_d(itemDB.itemList.equippable[this.N]);
    this.g.find(".form-header").text(`${a} (${this.o.length}/${this.R})`);
    a = le_Td(this.s, this.N, this.o);
    this.Ba.attr("valid-entry", a);
  }
  C() {
    super.C();
    le_Oj(this);
  }
}
function le_Rj() {
  return null != itemDB.affixList.categoryHeaders;
}
function le_Sj(a) {
  a.m = $(`<div class="form-options">
				<div class="respect-conditions-block">
					<div class="checkbox"></div>
					<div class="checkbox-label"></div>
					${le_Cj()}
				</div>
				<div class="filler"></div>
				<div class="entry-groupby-block">
					<div class="entry-groupby-select">
						<div class="select-wrapper"></div>
					</div>
				</div>
				<div class="entry-orderby-block">
					<div class="entry-orderby-select">
						<div class="select-wrapper"></div>
					</div>
				</div>
			</div>`);
  a.W = a.m.find(".respect-conditions-block");
  a.W.click(function () {
    const b = $(this);
    a.A = !a.A;
    le_4(b, a.A);
    le_bd("affixes_restrict", a.A);
    a.F();
  });
  a.Ba = a.m.find(".filter-restrictions-warning-icon");
  a.m.appendTo(a.Aa);
  le_Tj(a, a.m.find(".entry-groupby-block .select-wrapper"));
  le_Uj(a, a.m.find(".entry-orderby-block .select-wrapper"));
  le_4(a.m.find(".respect-conditions-block"), a.A);
  le_1(a.m.find(".entry-groupby-block select"), a.G, !0);
  le_1(a.m.find(".entry-orderby-block select"), a.D, !0);
  a.oa = tippy(a.m.find(".respect-conditions-block")[0], {
    content: "",
    allowHTML: !0,
    arrow: !1,
    placement: "bottom",
  });
  le_Vj(a);
}
function le_Tj(a, b) {
  const c = [];
  a.Mb.forEach(function (d) {
    var f = c.push;
    a: {
      switch (d) {
        case 0:
          var k = le_.t("loot_filters.affix_form.group_by.category");
          break a;
        case 1:
          k = le_.t("loot_filters.affix_form.group_by.type");
          break a;
        case 2:
          k = le_.t("loot_filters.affix_form.group_by.rarity");
          break a;
      }
      k = void 0;
    }
    f.call(c, le_5(d, k));
  });
  le_2(b, c, function (d) {
    a.G = d;
    le_bd("affixes_groupby", a.G);
    a.F();
  });
}
function le_Uj(a, b) {
  const c = [];
  a.Za.forEach(function (d) {
    var f = c.push;
    a: {
      switch (d) {
        case 0:
          var k = le_.t("loot_filters.affix_form.order_by.title");
          break a;
        case 1:
          k = le_.t("loot_filters.affix_form.order_by.rarity");
          break a;
      }
      k = void 0;
    }
    f.call(c, le_5(d, k));
  });
  le_2(b, c, function (d) {
    a.D = d;
    le_bd("affixes_orderby", a.D);
    a.F();
  });
}
function le_Vj(a) {
  a.m
    .find(".checkbox-label")
    .text(le_.t("loot_filters.affix_form.checkbox.apply_restrictions"));
  const b = le_.t(
      "loot_filters.affix_form.checkbox.apply_restrictions.hint_line_1"
    ),
    c = le_.t(
      "loot_filters.affix_form.checkbox.apply_restrictions.hint_line_2",
      {},
      "highlight"
    ),
    d = le_.t(
      "loot_filters.affix_form.checkbox.apply_restrictions.hint_line_3"
    ),
    f = le_.t(
      "loot_filters.affix_form.checkbox.apply_restrictions.hint_line_4",
      { iconImage: le_Cj() }
    );
  a.oa.setContent(`<div class="tippy-restrictions-tooltip"> 
				<div class="option-text" style="padding:0px 0px 2px 0px">${b}</div>
				<div>${c}</div>
				<div class="option-text" style="padding:10px 0px 2px 0px">${d}</div>
				<div>${f}</div>
			</div>`);
}
function le_Wj(a) {
  const b = le_Md(a.s),
    c = le_Pd(a.s),
    d = {},
    f = [];
  le_Xj(a).forEach(function (m) {
    var p = m.displayCategory;
    const r = a.S || ((!b || b.Sa(m)) && (!c || c.Sa(m)));
    var w = !a.A || r;
    (null == a.N || a.N.includes(p)) &&
      w &&
      0 < m.canRollOn.length &&
      ((p = m.rarityTier),
      (w = d[p]),
      null == w && ((w = []), (d[p] = w)),
      w.push(m),
      r && f.push(m.affixId));
  });
  const k = [],
    n = [];
  ["T4", "T3", "T2", "T1", "T0"].forEach(function (m) {
    const p = d[m];
    p && (p.sort(a.ga.bind(a)), n.push({ name: $db.pc(m), affixes: p }));
  });
  0 < n.length && k.push({ name: null, categories: n });
  return [k, f];
}
function le_Yj(a) {
  const b = le_Md(a.s),
    c = le_Pd(a.s),
    d = {},
    f = [];
  le_Xj(a).forEach(function (r) {
    var w = r.displayCategory;
    const z = a.S || ((!b || b.Sa(r)) && (!c || c.Sa(r)));
    var I = !a.A || z;
    (null == a.N || a.N.includes(w)) &&
      I &&
      0 < r.canRollOn.length &&
      ((w = le_t[r.id] ? 0 : 1),
      (I = d[w]),
      null == I && ((I = []), (d[w] = I)),
      I.push(r),
      z && f.push(r.affixId));
  });
  const k = le_.t("loot_filters.affix_form.categories.prefix"),
    n = le_.t("loot_filters.affix_form.categories.suffix"),
    m = [],
    p = [];
  [0, 1].forEach(function (r) {
    const w = d[r];
    w && (w.sort(a.ga.bind(a)), p.push({ name: 0 == r ? k : n, affixes: w }));
  });
  0 < p.length && m.push({ name: null, categories: p });
  return [m, f];
}
function le_Zj(a) {
  const b = le_Md(a.s),
    c = le_Pd(a.s),
    d = {},
    f = [];
  le_Xj(a).forEach(function (n) {
    const m = n.displayCategory,
      p = a.S || ((!b || b.Sa(n)) && (!c || c.Sa(n)));
    var r = !a.A || p;
    (null == a.N || a.N.includes(m)) &&
      r &&
      0 < n.canRollOn.length &&
      ((r = d[m]),
      null == r && ((r = []), (d[m] = r)),
      r.push(n),
      p && f.push(n.affixId));
  });
  const k = [];
  itemDB.affixList.categoryHeaders.forEach(function (n) {
    const m = le_Ga(n),
      p = 1 == n.categories.length,
      r = [];
    n.categories.forEach(function (w) {
      const z = d[w];
      z &&
        (z.sort(a.ga.bind(a)),
        (w =
          null != itemDB.affixList.displayCategoryKeys
            ? le_b(itemDB.affixList.displayCategoryKeys[w])
            : itemDB.affixList.displayCategories[w]),
        !w && p && (w = m),
        r.push({ name: w, affixes: z }));
    });
    0 < r.length && k.push({ name: m, categories: r });
  });
  return [k, f];
}
function le__j(a) {
  const b = $db.pc(a.rarityTier),
    c = $db.cd(a),
    d = [];
  a.affixProperties.forEach(function (f) {
    const k = $db.ad(a, f);
    f = $db.bd(f.modifierType);
    d.push(`<div>${k}<span class="entry-affix-type">(${f})</span></div>`);
  });
  return d.join("") + `<div class="entry-stats">${c} / ${b}</div>`;
}
function le_Xj(a) {
  return null != a.mb ? a.mb : Object.values(le_A);
}
class le_fi extends le_Kj {
  constructor() {
    super("filter-affix-form-overlay", "filter-affix-form");
    const a = le_Rj();
    this.nb = a ? 0 : 1;
    this.A = le_ed.g.load("affixes_restrict", !0);
    this.G = le_ed.g.load("affixes_groupby");
    null == this.G && (this.G = this.nb);
    0 != this.G || a || (this.G = this.nb);
    this.D = le_ed.g.load("affixes_orderby");
    null == this.D && (this.D = 0);
    this.Mb = [0, 1, 2];
    a || this.Mb.shift();
    this.Za = [0, 1];
    le_Rj()
      ? (this.N = itemDB.affixList.categoryHeaders
          .map(function (b) {
            return b.categories;
          })
          .flat())
      : (this.N = null);
  }
  V() {
    super.V();
    le_Sj(this);
  }
  show(a, b, c, d) {
    this.S = !1;
    super.show(a, b, c, d);
    this.W.show();
  }
  ud(a, b) {
    const c = new le_N(null, le_K, 0, !1, null, [], !1);
    this.S = !0;
    super.show(c, a, b, !1);
    this.W.hide();
  }
  ae(a, b, c) {
    const d = new le_N(null, le_K, 0, !1, null, [], !1);
    this.mb = Object.values(le_A).filter(function (f) {
      return a.includes(f.affixId);
    });
    this.S = !0;
    super.show(d, b, c, !1);
    this.W.hide();
  }
  ca() {}
  Y() {
    this.M();
    le_Jj(this);
  }
  M() {
    const a = this;
    let b;
    b = 2 == a.G ? le_Wj(a) : 1 == a.G ? le_Yj(a) : le_Zj(a);
    const [c, d] = b;
    let f = 0;
    const k = [];
    c.forEach(function (n) {
      const m = [];
      n.categories.forEach(function (r) {
        const w = [],
          z = [];
        r.affixes.forEach(function (C) {
          const G = C.affixId,
            H = $db.hd(C);
          C = le__j(C);
          const x =
            C.replace(/(<([^>]+)>)/gi, " ").replace(/\s+/g, " ") + " " + H;
          w.push(le_Ej(G, x, C, { fc: !0, $c: "with-extras", fe: H }));
          z.push(G);
        });
        f += r.affixes.length;
        r = r.name;
        const I = w.join(""),
          N = z
            .filter(function (C) {
              return d.includes(C);
            })
            .join(",");
        m.push(le_Dj(z, N, r, I, { fc: !0 }));
      });
      a.R = f;
      n = n.name;
      const p = m.join("");
      k.push(
        null == n
          ? `<div class="group-block">
			<div class="group-block-contents">${p}</div>
		</div>`
          : a.ba(n, p)
      );
    });
    k.push(le_Fj());
    a.j.html(k.join(""));
    a.j.find(".category-entry").each(function () {
      const n = $(this),
        m = +n.attr("entry-id");
      n.attr("valid-entry", -1 != d.indexOf(m));
    });
  }
  ga(a, b) {
    if (1 == this.D) {
      const c = a.rerollChance,
        d = b.rerollChance;
      if (c != d) return c - d;
    }
    a = $db.getItemName(a).toLowerCase();
    b = $db.getItemName(b).toLowerCase();
    return a.localeCompare(b);
  }
  T() {
    var a = le_.t("loot_filters.affix_form.title");
    this.g.find(".form-header").text(`${a} (${this.o.length}/${this.R})`);
    a = le_Ud(this.s, this.o);
    this.Ba.attr("valid-entry", a);
  }
  C() {
    super.C();
    le_Vj(this);
  }
}
class le_zj extends le_Kj {
  constructor() {
    super(
      "filter-wizard-item-type-form-overlay",
      "filter-wizard-item-type-form"
    );
  }
  ca() {}
  Y() {
    this.M();
    le_Jj(this);
  }
  show(a, b, c, d) {
    const f = new le_N(null, le_K, 0, !1, null, [], !1);
    this.title = a;
    this.m = b;
    super.show(f, c, d, !1);
  }
  M() {
    const a = this;
    let b = 0;
    const c = [];
    itemDB.itemList.lootFilterVisualCategories.forEach(function (d) {
      const f = [];
      d.categories.forEach(function (k) {
        const n = [],
          m = [];
        k.entries.forEach(function (p) {
          if (a.m.includes(p)) {
            const r = le_d(itemDB.itemList.equippable[p]);
            m.push(p);
            n.push(le_Ej(p, r, r));
          }
        });
        if (0 < n.length) {
          b += n.length;
          k = le_Ha(k);
          const p = m.join(",");
          f.push(le_Dj(p, p, k, n.join("")));
        }
      });
      0 < f.length && c.push(a.ba(f.join("")));
    });
    a.R = b;
    a.j.html(c.join(""));
  }
  F() {
    super.F();
    this.j.find(".category-block").addClass("expanded");
    this.Aa.hide();
  }
  ba(a) {
    return `<div class="group-block">
			<div class="group-block-contents">${a}</div>
		</div>`;
  }
  T() {
    this.g
      .find(".form-header")
      .text(`${this.title} (${this.o.length}/${this.R})`);
  }
  C() {
    super.C();
  }
}
window.getBasePath = function () {
  return "/loot-filters";
};
window.getGDHost = function () {
  return "/";
};
const le_0j = "undefined" !== typeof nw && null != nw;
let le_1j = !1,
  le_2j = !1,
  le_3j = !1,
  le_4j = !1,
  le_$f = "",
  le__ = "";
function le_5j() {
  return le_c(window.getBasePath());
}
le_.init({
  namespaces: ["full"],
  ve: dataVersion,
  we: langGameCacheMarker,
  $e: langSiteCacheMarker,
  Mc: function () {
    le_1j = !0;
    le_6j();
  },
  Lc: function () {
    le_7j();
    le_0.initData();
    le_0.P();
    le_8j();
  },
});
le_.run();
function le_9j(a) {
  this.g = [];
  this.i = -1;
  this.l = a;
}
function le_$j(a) {
  a = a || "";
  "/" == a[a.length - 1] && (a = a.substr(0, a.length - 1));
  var b = a.split("?");
  a = b[0];
  b = b[1];
  if (0 == a.indexOf(window.getBasePath()))
    a = a.substr(window.getBasePath().length);
  else return null;
  const c = a.split("/");
  "" == c[0] && c.shift();
  let d = c.shift();
  var f;
  if ((f = d)) f = -1 != le_.availableLanguages.indexOf(d);
  f && (d = c.shift());
  f = "shared";
  "shared" == d
    ? ((d = c.shift()), (f = "shared"))
    : "my" == d && ((d = c.shift()), (f = "my"));
  if ("view" == d)
    return (
      (a = c.shift()),
      (b = le_0.C.Ra[a]),
      { lootFilterId: a, title: b ? b.title : null }
    );
  le_$f = a;
  le__ = "shared" == f ? "" : `/${f}`;
  if ("filter" == d) {
    if ((a = c.shift()))
      return {
        category: f,
        title: le_0.Ic(a),
        query: a,
        page: +(c.shift() || 1),
      };
  } else
    return (
      (a = 1),
      +d == d && Number.isInteger(+d) && (a = +d),
      { category: f, title: le_0.Ic(b), query: "", page: a || 1 }
    );
}
let le_ak;
if (le_0j)
  le_ak = new le_9j(function (a) {
    le_bk(a);
  });
else {
  const a = window.location.pathname;
  let b = !1;
  History.Adapter.bind(window, "statechange", function () {
    const c = $("title").text();
    var d = le_.t("loot_filters.title");
    $("title").text() == d
      ? (d =
          le_.g == le_.i
            ? [
                "Last Epoch, action rpg, loot, filters, builds, planner, calculator, guides, filter, skills, compendium, beginner, leveling, hardcore, endgame",
              ]
            : ["Last Epoch", d])
      : ((d = c.split(" - ")), d.unshift("Last Epoch"));
    $("meta[name=keywords]").attr("content", d.join(", "));
    le_bk(le_ck());
    (b || a != window.location.pathname) &&
      window.gtag &&
      (window.gtag("config", "G-DX2B5VG2GW", {
        page_title: c,
        page_path: window.location.pathname,
      }),
      le_dk());
    b = !0;
  });
}
function le_dk(a) {
  le_h("filters-left", a);
  le_h("filters-left-big", a);
  le_h("filters-right", a);
  le_h("filters-right-big", a);
  le_h("filters-top", a);
  le_h("filters-top-small", a);
  le_h("filters-top-logo", a);
  le_h("filters-bottom", a);
  le_h("filters-bottom-small", a);
  le_h("filters-bottom-big", a);
}
function le_ck() {
  // D2Core: fixed path
  // var a = History.getState().hash;
  var a = "/loot-filters/zh/view/aBZjJDB4";
  return le_$j(a) || {};
}
function le_ek(a) {
  let b = le_.t("loot_filters.title");
  a.title && (b += " --- " + a.title);
  var c = le_5j();
  if (a.lootFilterId) c += "/view/" + a.lootFilterId;
  else {
    var d = a.category;
    const f = a.query,
      k = a.page,
      n = a.query,
      m = k && 1 != k;
    d && "shared" != d && (c += "/" + d);
    n && (d = le_0.sd(f)) && (c += "/filter/" + d);
    m && (c += "/" + k);
  }
  c == le_5j() && (c += "/");
  b = b.split(" --- ").reverse().join(" - ");
  return { title: b, data: a, url: c };
}
function le_Z(a) {
  a = le_5j() + a;
  a = le_$j(a) || {};
  if (le_0j) {
    var b = le_ak;
    b.g = b.g.slice(0, b.i + 1);
    b.g.push(a);
    b.i++;
    b.l && b.l(b.g[b.i]);
  } else (a = le_ek(a)), History.pushState(a.data, a.title, a.url);
}
function le_8j() {
  if (le_0j)
    if (le_0j) {
      var a = le_ak;
      a.l && a.l(a.g[a.i]);
    } else le_bk(le_ck());
  else
    (a = le_ck()),
      (a = le_ek(a)),
      History.getState(),
      a.data || (a.data = {}),
      (a.data.rand = Math.random()),
      History.replaceState(a.data, a.title, a.url);
}
function le_bk(a) {
  var b = !a || $.isEmptyObject(a),
    c = !a.category || "shared" == a.category;
  const d = +a.page || 1;
  le_ag(le_0);
  b
    ? le_cg(c, "", d)
    : a.query
    ? le_cg(c, a.query, d)
    : a.lootFilterId
    ? ((a = a.lootFilterId),
      (b = le_0),
      b.i.removeClass("with-list"),
      b.i.addClass("with-viewer"),
      (c = b.C.Ra[a]) ? le_9g(b.l, c) : le_9g(b.l, { id: a }))
    : le_cg(c, "", d);
}
function le_7j() {
  let a = "loot-filters";
  le_.g && (a += " locale-" + le_.g);
  $(document.body).hasClass("fw") && (a += " fw");
  $(document.body).hasClass("layout-mobile") && (a += " layout-mobile");
  $(document.body).attr("class", a);
}
let le_Hi = 100;
const le_jg = new le_id();
let le_0;
$(document).ready(function () {
  try {
    window.gtag &&
      window.gtag("event", "page_load", { event_category: "engagement" });
  } catch (a) {
    console.log(a);
  }
  le_dk(!0);
  le_2j = !0;
  le_6j();
});
isLoggedIn
  ? le_4f(
      function (a) {
        userLootFilters = a.lootFilters;
        userLootFilterTemplates = a.lootFilterTemplates;
        le_jg.init();
        le_3j = !0;
        le_6j();
      },
      function () {
        le_3j = !0;
        le_6j();
      }
    )
  : ((le_3j = !0), le_6j());
function le_6j() {
  le_1j &&
    le_2j &&
    le_3j &&
    !le_4j &&
    ((le_4j = !0),
    le_7j(),
    (le_0 = new le_ig()),
    le_0.initData(),
    le_0.V(),
    le_0.P(),
    le_8j(),
    $(".page-loading-overlay").fadeOut());
}
let le_Di = !1;
$(document).on("keydown keyup", function (a) {
  le_Di = a.shiftKey;
});
function le_Kg(a) {
  return (a + "").replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
function le_7f(a) {
  return a.ctrlKey || a.shiftKey || a.altKey ? !1 : !0;
}
$.ia = function (a, b) {
  a = new RegExp("(?:^|&)" + b + "=([^&#]*)").exec(a);
  return null == a ? null : decodeURI(a[1]) || 0;
};
function le_xg(a, b) {
  let c;
  return function () {
    const d = this,
      f = arguments;
    clearTimeout(c);
    c = setTimeout(function () {
      c = null;
      a.apply(d, f);
    }, b);
  };
}
